mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Stop parsing into IfConfiDecl nodes in the C++ parser
When parsing #if...#endif regions, parse the active clause directly into place in the AST without ever producing an IfConfigDecl instance.
This commit is contained in:
@@ -822,9 +822,11 @@ bool Parser::parseEndIfDirective(SourceLoc &Loc) {
|
||||
Loc = PreviousLoc;
|
||||
skipUntilConditionalBlockClose();
|
||||
return true;
|
||||
} else if (!Tok.isAtStartOfLine() && Tok.isNot(tok::eof))
|
||||
} else if (!Tok.isAtStartOfLine() && Tok.isNot(tok::eof)) {
|
||||
diagnose(Tok.getLoc(),
|
||||
diag::extra_tokens_conditional_compilation_directive);
|
||||
skipUntilTokenOrEndOfLine(tok::NUM_TOKENS);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user