]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40334: Fix error location upon parsing an invalid string literal (GH-19962)
authorLysandros Nikolaou <lisandrosnik@gmail.com>
Thu, 7 May 2020 10:37:51 +0000 (13:37 +0300)
committerGitHub <noreply@github.com>
Thu, 7 May 2020 10:37:51 +0000 (11:37 +0100)
commit2f37c355ab0e9ec9c1753985d27c41fa0bd719b9
tree2295b4c14a0d54f6db7d9248e17924c267e31700
parent3466922320d54a922cfe6d6d44e89e1cea4023ef
bpo-40334: Fix error location upon parsing an invalid string literal (GH-19962)

When parsing a string with an invalid escape, the old parser used to
point to the beginning of the invalid string. This commit changes the new
parser to match that behaviour, since it's currently pointing to the
end of the string (or to be more precise, to the beginning of the next
token).
Lib/test/test_cmd_line_script.py
Lib/test/test_string_literals.py
Parser/pegen/parse_string.c
Parser/pegen/parse_string.h
Parser/pegen/pegen.c
Parser/pegen/pegen.h