]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40847: Consider a line with only a LINECONT a blank line (GH-20769)
authorLysandros Nikolaou <lisandrosnik@gmail.com>
Wed, 10 Jun 2020 23:56:08 +0000 (02:56 +0300)
committerGitHub <noreply@github.com>
Wed, 10 Jun 2020 23:56:08 +0000 (00:56 +0100)
commit896f4cf63f9ab93e30572d879a5719d5aa2499fb
treeb24213dfd64cf197fcab434adce912f37c3b87a7
parent7f888c7ef905842bf7739cc03bd20398329951b5
bpo-40847: Consider a line with only a LINECONT a blank line (GH-20769)

A line with only a line continuation character should be considered
a blank line at tokenizer level so that only a single NEWLINE token
gets emitted. The old parser was working around the issue, but the
new parser threw a `SyntaxError` for valid input. For example,
an empty line following a line continuation character was interpreted
as a `SyntaxError`.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Lib/test/test_peg_parser.py
Lib/test/test_syntax.py
Misc/NEWS.d/next/Core and Builtins/2020-06-09-23-52-32.bpo-40847.4XAACw.rst [new file with mode: 0644]
Parser/tokenizer.c