Commit 4ffed7a1 authored by Roberto Raggi's avatar Roberto Raggi Committed by Roberto Raggi
Browse files

Fixes: Parsing of #import directives.

parent c00e3018
...@@ -727,6 +727,7 @@ void Preprocessor::processDirective(TokenIterator firstToken, TokenIterator last ...@@ -727,6 +727,7 @@ void Preprocessor::processDirective(TokenIterator firstToken, TokenIterator last
case PP_INCLUDE: case PP_INCLUDE:
case PP_INCLUDE_NEXT: case PP_INCLUDE_NEXT:
case PP_IMPORT:
if (! skipping()) if (! skipping())
processInclude(d == PP_INCLUDE_NEXT, firstToken, lastToken); processInclude(d == PP_INCLUDE_NEXT, firstToken, lastToken);
break; break;
...@@ -1069,6 +1070,8 @@ Preprocessor::PP_DIRECTIVE_TYPE Preprocessor::classifyDirective (const QByteArra ...@@ -1069,6 +1070,8 @@ Preprocessor::PP_DIRECTIVE_TYPE Preprocessor::classifyDirective (const QByteArra
case 6: case 6:
if (__directive[0] == 'i' && __directive == "ifndef") if (__directive[0] == 'i' && __directive == "ifndef")
return PP_IFNDEF; return PP_IFNDEF;
else if (__directive[0] == 'i' && __directive == "import")
return PP_IMPORT;
else if (__directive[0] == 'd' && __directive == "define") else if (__directive[0] == 'd' && __directive == "define")
return PP_DEFINE; return PP_DEFINE;
break; break;
......
...@@ -150,6 +150,7 @@ namespace CPlusPlus { ...@@ -150,6 +150,7 @@ namespace CPlusPlus {
{ {
PP_UNKNOWN_DIRECTIVE, PP_UNKNOWN_DIRECTIVE,
PP_DEFINE, PP_DEFINE,
PP_IMPORT,
PP_INCLUDE, PP_INCLUDE,
PP_INCLUDE_NEXT, PP_INCLUDE_NEXT,
PP_ELIF, PP_ELIF,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment