summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-01-14 18:27:17 (GMT)
committerGuido van Rossum <guido@python.org>1992-01-14 18:27:17 (GMT)
commit526e9096146fe56a9df191ae257ceed71405ff1e (patch)
tree648effd5d523e6b3bd138ab435c01d2ad6090bd8
parente9cde31c475d2838a0bed107ed285ad594293352 (diff)
downloadcpython-526e9096146fe56a9df191ae257ceed71405ff1e.zip
cpython-526e9096146fe56a9df191ae257ceed71405ff1e.tar.gz
cpython-526e9096146fe56a9df191ae257ceed71405ff1e.tar.bz2
Added varargs syntax "def f(a, b, +c): ..."
-rw-r--r--Grammar/Grammar16
1 files changed, 11 insertions, 5 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index e61a874..3462edd 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -1,7 +1,12 @@
-# Grammar for Python, version 10
+# Grammar for Python
-# Changes since version 9:
-# Equality is now only tested with '=='
+# Change log:
+
+# 11-Jan-92:
+# Variable length argument list syntax added: def f(a, b, +rest): ...
+
+# 8-Jan-92:
+# Allow only '==' for equality testing
# Changes since version 8:
# Trailing commas in formal parameter lists are allowed
@@ -56,9 +61,10 @@ expr_input: testlist NEWLINE
eval_input: testlist ENDMARKER
funcdef: 'def' NAME parameters ':' suite
-parameters: '(' [fplist] ')'
-fplist: fpdef (',' fpdef)* [',']
+parameters: '(' [varargslist] ')'
+varargslist: (fpdef ',')* '+' NAME | fpdef (',' fpdef)* [',']
fpdef: NAME | '(' fplist ')'
+fplist: fpdef (',' fpdef)* [',']
stmt: simple_stmt | compound_stmt
simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE