mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[incParse] Make the SytnaxParsingCache operate on the leading trivia's start
This commit is contained in:
@@ -718,7 +718,7 @@ bool Parser::loadCurrentSyntaxNodeFromCache() {
|
||||
unsigned LexerOffset =
|
||||
SourceMgr.getLocOffsetInBuffer(Tok.getLoc(), L->getBufferID());
|
||||
unsigned LeadingTriviaOffset = LexerOffset - LeadingTrivia.getTextLength();
|
||||
if (auto TextLength = SyntaxContext->loadFromCache(LexerOffset)) {
|
||||
if (auto TextLength = SyntaxContext->loadFromCache(LeadingTriviaOffset)) {
|
||||
L->resetToOffset(LeadingTriviaOffset + TextLength);
|
||||
L->lex(Tok, LeadingTrivia, TrailingTrivia);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user