mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-45727: Only trigger the 'did you forgot a comma' error suggestion if inside parentheses (GH-29757)
This commit is contained in:
parent
f4afc53bf6
commit
24c10d2943
8 changed files with 15 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue