@@ -335,14 +335,16 @@ swift::tokenizeWithTrivia(const LangOptions &LangOpts, const SourceManager &SM,
335
335
336
336
Parser::Parser (unsigned BufferID, SourceFile &SF, SILParserTUStateBase *SIL,
337
337
PersistentParserState *PersistentState,
338
- std::shared_ptr<SyntaxParseActions> SPActions)
338
+ std::shared_ptr<SyntaxParseActions> SPActions,
339
+ bool DisableDelayedParsing)
339
340
: Parser(BufferID, SF, &SF.getASTContext().Diags, SIL, PersistentState,
340
- std::move(SPActions)) {}
341
+ std::move(SPActions), DisableDelayedParsing ) {}
341
342
342
343
Parser::Parser (unsigned BufferID, SourceFile &SF, DiagnosticEngine* LexerDiags,
343
344
SILParserTUStateBase *SIL,
344
345
PersistentParserState *PersistentState,
345
- std::shared_ptr<SyntaxParseActions> SPActions)
346
+ std::shared_ptr<SyntaxParseActions> SPActions,
347
+ bool DisableDelayedParsing)
346
348
: Parser(
347
349
std::unique_ptr<Lexer>(new Lexer(
348
350
SF.getASTContext().LangOpts, SF.getASTContext().SourceMgr,
@@ -357,7 +359,7 @@ Parser::Parser(unsigned BufferID, SourceFile &SF, DiagnosticEngine* LexerDiags,
357
359
SF.shouldBuildSyntaxTree()
358
360
? TriviaRetentionMode::WithTrivia
359
361
: TriviaRetentionMode::WithoutTrivia)),
360
- SF, SIL, PersistentState, std::move(SPActions)) {}
362
+ SF, SIL, PersistentState, std::move(SPActions), DisableDelayedParsing ) {}
361
363
362
364
namespace {
363
365
@@ -477,14 +479,16 @@ class TokenRecorder: public ConsumeTokenReceiver {
477
479
Parser::Parser (std::unique_ptr<Lexer> Lex, SourceFile &SF,
478
480
SILParserTUStateBase *SIL,
479
481
PersistentParserState *PersistentState,
480
- std::shared_ptr<SyntaxParseActions> SPActions)
482
+ std::shared_ptr<SyntaxParseActions> SPActions,
483
+ bool DisableDelayedParsing)
481
484
: SourceMgr(SF.getASTContext().SourceMgr),
482
485
Diags(SF.getASTContext().Diags),
483
486
SF(SF),
484
487
L(Lex.release()),
485
488
SIL(SIL),
486
489
CurDeclContext(&SF),
487
490
Context(SF.getASTContext()),
491
+ DisableDelayedParsing(DisableDelayedParsing),
488
492
TokReceiver(SF.shouldCollectToken() ?
489
493
new TokenRecorder(SF) :
490
494
new ConsumeTokenReceiver()),
0 commit comments