bpo-45727: Only trigger the 'did you forgot a comma' error suggestion if inside parentheses (GH-29757)

This commit is contained in:
Pablo Galindo Salgado 2021-11-24 22:21:23 +00:00 committed by GitHub
parent f4afc53bf6
commit 24c10d2943
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 8 deletions

View file

@ -170,6 +170,8 @@ initialize_token(Parser *p, Token *token, const char *start, const char *end, in
return -1;
}
token->level = p->tok->level;
const char *line_start = token_type == STRING ? p->tok->multi_line_start : p->tok->line_start;
int lineno = token_type == STRING ? p->tok->first_lineno : p->tok->lineno;
int end_lineno = p->tok->lineno;
@ -946,4 +948,4 @@ _PyPegen_run_parser_from_string(const char *str, int start_rule, PyObject *filen
error:
_PyTokenizer_Free(tok);
return result;
}
}