summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2000-08-21 15:34:33 (GMT)
committerBarry Warsaw <barry@python.org>2000-08-21 15:34:33 (GMT)
commit0360663e8e8b0e7b18ce8d390995fcbad140f7e0 (patch)
treef819a617e70a2ae8dbddf6da95fe5f0f2bcdf264 /Grammar
parent9b18adcd1695d527fb8930cddc4419caac3c1ffa (diff)
downloadcpython-0360663e8e8b0e7b18ce8d390995fcbad140f7e0.zip
cpython-0360663e8e8b0e7b18ce8d390995fcbad140f7e0.tar.gz
cpython-0360663e8e8b0e7b18ce8d390995fcbad140f7e0.tar.bz2
PEP 214, Extended print Statement, has been accepted by the BDFL.
This change modifies Python's grammar to include the extended print form.
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar4
1 files changed, 2 insertions, 2 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index 02e2edd..f95923d 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -30,10 +30,10 @@ fplist: fpdef (',' fpdef)* [',']
stmt: simple_stmt | compound_stmt
simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
#small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | access_stmt | exec_stmt
-small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | exec_stmt | assert_stmt
+small_stmt: expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt | import_stmt | global_stmt | exec_stmt | assert_stmt
expr_stmt: testlist ('=' testlist)*
# For assignments, additional restrictions enforced by the interpreter
-print_stmt: 'print' (test ',')* [test]
+print_stmt: 'print' ( [ test (',' test)* [','] ] | '>>' test [ (',' test)+ [','] ] )
del_stmt: 'del' exprlist
pass_stmt: 'pass'
flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt