Merge pull request #18616 from akyrtzi/input-complete-invalid-interpolation

[parser] Make corrections for the isInputIncomplete() functionality
This commit is contained in:
Argyrios Kyrtzidis
2018-08-09 18:46:21 -07:00
committed by GitHub
8 changed files with 31 additions and 1 deletions

View File

@@ -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;