0
0
mirror of https://github.com/python/cpython.git synced 2024-11-25 01:20:47 +01:00
cpython/Parser
Pablo Galindo a77aac4fca
bpo-43914: Highlight invalid ranges in SyntaxErrors (#25525)
To improve the user experience understanding what part of the error messages associated with SyntaxErrors is wrong, we can highlight the whole error range and not only place the caret at the first character. In this way:

>>> foo(x, z for z in range(10), t, w)
  File "<stdin>", line 1
    foo(x, z for z in range(10), t, w)
           ^
SyntaxError: Generator expression must be parenthesized

becomes

>>> foo(x, z for z in range(10), t, w)
  File "<stdin>", line 1
    foo(x, z for z in range(10), t, w)
           ^^^^^^^^^^^^^^^^^^^^
SyntaxError: Generator expression must be parenthesized
2021-04-23 14:27:05 +01:00
..
asdl_c.py
asdl.py
myreadline.c
parser.c bpo-43914: Highlight invalid ranges in SyntaxErrors (#25525) 2021-04-23 14:27:05 +01:00
peg_api.c
pegen.c bpo-43914: Highlight invalid ranges in SyntaxErrors (#25525) 2021-04-23 14:27:05 +01:00
pegen.h bpo-43914: Highlight invalid ranges in SyntaxErrors (#25525) 2021-04-23 14:27:05 +01:00
Python.asdl
string_parser.c
string_parser.h
token.c
tokenizer.c
tokenizer.h