From: Guido van Rossum Date: Sat, 27 Jul 1991 21:29:47 +0000 (+0000) Subject: Change treatment of multiple NEWLINES X-Git-Tag: v0.9.8~870 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ac4a88721b784e80c0a0f05a868e62fbc14e947;p=thirdparty%2FPython%2Fcpython.git Change treatment of multiple NEWLINES --- diff --git a/Grammar/Grammar b/Grammar/Grammar index 111ae6012bb3..c3ab3c32c65c 100644 --- a/Grammar/Grammar +++ b/Grammar/Grammar @@ -1,6 +1,9 @@ # Grammar for Python, version 5 # Changes compared to version 4: +# Blank lines and lines only containing a comment are now eaten +# by the lexer, so the NEWLINE* things in suite are gone +# (but the 2nd NEWLINE terminating single_input stays!) # Semicolons can separate small statements # 'continue' statement # Dictionary constructors: {key:value, key:value, ...} @@ -59,7 +62,7 @@ while_stmt: 'while' test ':' suite ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] try_stmt: 'try' ':' suite (except_clause ':' suite)* ['finally' ':' suite] except_clause: 'except' [test [',' test]] -suite: simple_stmt | NEWLINE INDENT NEWLINE* (stmt NEWLINE*)+ DEDENT +suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT test: and_test ('or' and_test)* and_test: not_test ('and' not_test)*