mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Parser: disable lexer diagnostics during delayed parsing.
The lexer diagnostics have already been emitted during token skipping.
This commit is contained in:
@@ -331,12 +331,18 @@ swift::tokenizeWithTrivia(const LangOptions &LangOpts, const SourceManager &SM,
|
||||
// Setup and Helper Methods
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
|
||||
Parser::Parser(unsigned BufferID, SourceFile &SF, SILParserTUStateBase *SIL,
|
||||
PersistentParserState *PersistentState)
|
||||
: Parser(BufferID, SF, &SF.getASTContext().Diags, SIL, PersistentState) {}
|
||||
|
||||
Parser::Parser(unsigned BufferID, SourceFile &SF, DiagnosticEngine* LexerDiags,
|
||||
SILParserTUStateBase *SIL,
|
||||
PersistentParserState *PersistentState)
|
||||
: Parser(
|
||||
std::unique_ptr<Lexer>(new Lexer(
|
||||
SF.getASTContext().LangOpts, SF.getASTContext().SourceMgr,
|
||||
BufferID, &SF.getASTContext().Diags,
|
||||
BufferID, LexerDiags,
|
||||
/*InSILMode=*/SIL != nullptr,
|
||||
SF.Kind == SourceFileKind::Main
|
||||
? HashbangMode::Allowed
|
||||
|
||||
Reference in New Issue
Block a user