mirror of
https://github.com/python/cpython.git
synced 2025-08-29 13:15:11 +00:00
bpo-40267: Fix message when last input character produces a SyntaxError (GH-19521)
When there is a SyntaxError after reading the last input character from the tokenizer and if no newline follows it, the error message used to be `unexpected EOF while parsing`, which is wrong.
This commit is contained in:
parent
574547a75c
commit
9a4b38f66b
5 changed files with 13 additions and 1 deletions
|
@ -69,6 +69,10 @@ extern "C" {
|
|||
#define ISTERMINAL(x) ((x) < NT_OFFSET)
|
||||
#define ISNONTERMINAL(x) ((x) >= NT_OFFSET)
|
||||
#define ISEOF(x) ((x) == ENDMARKER)
|
||||
#define ISWHITESPACE(x) ((x) == ENDMARKER || \\
|
||||
(x) == NEWLINE || \\
|
||||
(x) == INDENT || \\
|
||||
(x) == DEDENT)
|
||||
|
||||
|
||||
PyAPI_DATA(const char * const) _PyParser_TokenNames[]; /* Token names */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue