diff options
author | Guido van Rossum <guido@python.org> | 1993-10-26 17:58:25 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-10-26 17:58:25 (GMT) |
commit | 12d12c5faf4d770160b7975b54e8f9b12694e012 (patch) | |
tree | e5528ca45963a90c5797073228090d221cdc6bba /Grammar | |
parent | 444fc7c90cf210ec72f1c4204310f659263b6f75 (diff) | |
download | cpython-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/Grammar | 10 |
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] |