diff options
author | Guido van Rossum <guido@python.org> | 1993-11-30 14:57:42 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-11-30 14:57:42 (GMT) |
commit | 57531fea90ca0afe9efdc70d3dce1a3eb153f03e (patch) | |
tree | c1d0923a451f6a8c28307f229ba7e5b422a3d172 /Grammar | |
parent | ae3b3a33d85134b51505b3f0f3fdaf6afbffa79b (diff) | |
download | cpython-57531fea90ca0afe9efdc70d3dce1a3eb153f03e.zip cpython-57531fea90ca0afe9efdc70d3dce1a3eb153f03e.tar.gz cpython-57531fea90ca0afe9efdc70d3dce1a3eb153f03e.tar.bz2 |
change syntactical position of lambdef (was an atom, now is a test)
Diffstat (limited to 'Grammar')
-rw-r--r-- | Grammar/Grammar | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar index 6be7418..1a98a6a 100644 --- a/Grammar/Grammar +++ b/Grammar/Grammar @@ -123,7 +123,7 @@ try_stmt: 'try' ':' suite (except_clause ':' suite)+ | 'try' ':' suite 'finally' except_clause: 'except' [test [',' test]] suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT -test: and_test ('or' and_test)* +test: and_test ('or' and_test)* | lambdef and_test: not_test ('and' not_test)* not_test: 'not' not_test | comparison comparison: expr (comp_op expr)* @@ -135,9 +135,7 @@ shift_expr: arith_expr (('<<'|'>>') arith_expr)* arith_expr: term (('+'|'-') term)* term: factor (('*'|'/'|'%') factor)* factor: ('+'|'-'|'~') factor | atom trailer* -atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' [dictmaker] '}' | '`' testlist '`' | lambdef | NAME | NUMBER | STRING -# Note ambiguity in grammar: "lambda x: x[1]" could mean "(lambda x: x)[1]" -# but the parser is eager so interprets it as "lambda x: (x[1])"... +atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING lambdef: 'lambda' [varargslist] ':' test trailer: '(' [testlist] ')' | '[' subscript ']' | '.' NAME subscript: test | [test] ':' [test] |