mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
John Aycock correctly pointed out that the grammar for
"power" was formally ambiguous. Here's his fix.
This commit is contained in:
parent
c32f0336e0
commit
84ee323cb9
3 changed files with 4 additions and 4 deletions
|
|
@ -79,7 +79,7 @@ shift_expr: arith_expr (('<<'|'>>') arith_expr)*
|
|||
arith_expr: term (('+'|'-') term)*
|
||||
term: factor (('*'|'/'|'%'|'//') factor)*
|
||||
factor: ('+'|'-'|'~') factor | power
|
||||
power: atom trailer* ('**' factor)*
|
||||
power: atom trailer* ['**' factor]
|
||||
atom: '(' [testlist] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING+
|
||||
listmaker: test ( list_for | (',' test)* [','] )
|
||||
lambdef: 'lambda' [varargslist] ':' test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue