mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #18616 from akyrtzi/input-complete-invalid-interpolation
[parser] Make corrections for the isInputIncomplete() functionality
This commit is contained in:
@@ -1765,6 +1765,10 @@ ParserResult<Expr> Parser::parseExprPrimary(Diag<> ID, bool isExprBasic) {
|
||||
// Eat an invalid token in an expression context. Error tokens are diagnosed
|
||||
// by the lexer, so there is no reason to emit another diagnostic.
|
||||
case tok::unknown:
|
||||
if (Tok.getText().startswith("\"\"\"")) {
|
||||
// This was due to unterminated multi-line string.
|
||||
IsInputIncomplete = true;
|
||||
}
|
||||
consumeToken(tok::unknown);
|
||||
return nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user