summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1993-10-26 17:58:25 (GMT)
committerGuido van Rossum <guido@python.org>1993-10-26 17:58:25 (GMT)
commit12d12c5faf4d770160b7975b54e8f9b12694e012 (patch)
treee5528ca45963a90c5797073228090d221cdc6bba /Grammar
parent444fc7c90cf210ec72f1c4204310f659263b6f75 (diff)
downloadcpython-12d12c5faf4d770160b7975b54e8f9b12694e012.zip
cpython-12d12c5faf4d770160b7975b54e8f9b12694e012.tar.gz
cpython-12d12c5faf4d770160b7975b54e8f9b12694e012.tar.bz2
* compile.[ch]: support for lambda()
* PROTO.h, mymalloc.h: added #ifdefs for TURBOC and GNUC. * allobjects.h: added #include "rangeobject.h" * Grammar: added lambda_input; relaxed syntax for exec. * bltinmodule.c: added bagof, map, reduce, lambda, xrange. * tupleobject.[ch]: added resizetuple(). * rangeobject.[ch]: new object type to speed up range operations (not convinced this is needed!!!)
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar10
1 files changed, 7 insertions, 3 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar
index 1ba6b5c..22a48f7 100644
--- a/Grammar/Grammar
+++ b/Grammar/Grammar
@@ -2,6 +2,9 @@
# Change log:
+# 25-Oct-93:
+# Added lambda_input
+
# 18-Oct-93:
# Use testlist instead of exprlist in expr_stmt
# Add exec statement
@@ -75,13 +78,14 @@
# single_input is a single interactive statement;
# file_input is a module or sequence of commands read from an input file;
# expr_input is the input for the input() function;
-# eval_input is the input for the eval() function.
+# eval_input is the input for the eval() function;
+# lambda_input is the input for the proposed lambda() function.
# NB: compound_stmt in single_input is followed by extra NEWLINE!
single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE
file_input: (NEWLINE | stmt)* ENDMARKER
-expr_input: testlist NEWLINE
eval_input: testlist NEWLINE* ENDMARKER
+lambda_input: varargslist ':' testlist NEWLINE* ENDMARKER
funcdef: 'def' NAME parameters ':' suite
parameters: '(' [varargslist] ')'
@@ -108,7 +112,7 @@ access_stmt: 'access' ('*' | NAME (',' NAME)*) ':' accesstype (',' accesstype)*
accesstype: NAME+
# accesstype should be ('public' | 'protected' | 'private') ['read'] ['write']
# but can't be because that would create undesirable reserved words!
-exec_stmt: 'exec' expr ['in' expr [',' expr]]
+exec_stmt: 'exec' expr ['in' test [',' test]]
compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef
if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite]