mirror of
https://github.com/python/cpython.git
synced 2025-08-16 06:40:56 +00:00
bpo-45738: Fix computation of error location for invalid continuation characters in the parser (GH-29550) (GH-29552)
(cherry picked from commit 25835c518a
)
This commit is contained in:
parent
3e0b830e85
commit
142fcb40b6
4 changed files with 12 additions and 11 deletions
|
@ -953,7 +953,13 @@ def func2():
|
|||
def test_invalid_line_continuation_error_position(self):
|
||||
self._check_error(r"a = 3 \ 4",
|
||||
"unexpected character after line continuation character",
|
||||
lineno=1, offset=(10 if support.use_old_parser() else 9))
|
||||
lineno=1, offset=8)
|
||||
self._check_error('1,\\#\n2',
|
||||
"unexpected character after line continuation character",
|
||||
lineno=1, offset=4)
|
||||
self._check_error('\nfgdfgf\n1,\\#\n2\n',
|
||||
"unexpected character after line continuation character",
|
||||
lineno=3, offset=4)
|
||||
|
||||
def test_invalid_line_continuation_left_recursive(self):
|
||||
# Check bpo-42218: SyntaxErrors following left-recursive rules
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue