diff options
author | Guido van Rossum <guido@python.org> | 1991-07-27 21:29:47 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1991-07-27 21:29:47 (GMT) |
commit | 7ac4a88721b784e80c0a0f05a868e62fbc14e947 (patch) | |
tree | 2591c88d09e270d788af9f6bafeed167a2bf703f | |
parent | a60810973d07c3df88ce4bbefacc32681c329f2f (diff) | |
download | cpython-7ac4a88721b784e80c0a0f05a868e62fbc14e947.zip cpython-7ac4a88721b784e80c0a0f05a868e62fbc14e947.tar.gz cpython-7ac4a88721b784e80c0a0f05a868e62fbc14e947.tar.bz2 |
Change treatment of multiple NEWLINES
-rw-r--r-- | Grammar/Grammar | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar index 111ae60..c3ab3c3 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)* |