]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Change treatment of multiple NEWLINES
authorGuido van Rossum <guido@python.org>
Sat, 27 Jul 1991 21:29:47 +0000 (21:29 +0000)
committerGuido van Rossum <guido@python.org>
Sat, 27 Jul 1991 21:29:47 +0000 (21:29 +0000)
Grammar/Grammar

index 111ae6012bb38cacace1410026873ca4e7118b45..c3ab3c32c65cfb4fb7b487edd22c40f6d733c06c 100644 (file)
@@ -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)*