mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Move #line state into the Parser and out of the SourceManager.
As part of this change, allow #line directives to extend to the end of the file, rather than requiring a reset. Note that #line regions that start or end within function bodies will not behave correctly when in delayed parsing modes. This was true before and after this commit. (#line regions contained entirely within a function and not within any other #line regions should be fine.) Swift SVN r20571
This commit is contained in:
@@ -284,6 +284,7 @@ Parser::Parser(std::unique_ptr<Lexer> Lex, SourceFile &SF,
|
||||
SourceMgr.findBufferContainingLoc(ParserPos.Loc) == L->getBufferID()) {
|
||||
auto BeginParserPosition = getParserPosition(ParserPos);
|
||||
restoreParserPosition(BeginParserPosition);
|
||||
InPoundLineEnvironment = State->InPoundLineEnvironment;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user