Skip to content

Commit 84ee323

Browse files
committed
John Aycock correctly pointed out that the grammar for
"power" was formally ambiguous. Here's his fix.
1 parent c32f033 commit 84ee323

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

Grammar/Grammar

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ shift_expr: arith_expr (('<<'|'>>') arith_expr)*
7979
arith_expr: term (('+'|'-') term)*
8080
term: factor (('*'|'/'|'%'|'//') factor)*
8181
factor: ('+'|'-'|'~') factor | power
82-
power: atom trailer* ('**' factor)*
82+
power: atom trailer* ['**' factor]
8383
atom: '(' [testlist] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING+
8484
listmaker: test ( list_for | (',' test)* [','] )
8585
lambdef: 'lambda' [varargslist] ':' test

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Oliver Andrich
2020
Ross Andrus
2121
Jason Asbahr
2222
David Ascher
23+
John Aycock
2324
Donovan Baarda
2425
Alfonso Baciero
2526
Stig Bakken

Python/graminit.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,15 +1005,14 @@ static arc arcs_48_1[3] = {
10051005
static arc arcs_48_2[1] = {
10061006
{119, 3},
10071007
};
1008-
static arc arcs_48_3[2] = {
1009-
{24, 2},
1008+
static arc arcs_48_3[1] = {
10101009
{0, 3},
10111010
};
10121011
static state states_48[4] = {
10131012
{1, arcs_48_0},
10141013
{3, arcs_48_1},
10151014
{1, arcs_48_2},
1016-
{2, arcs_48_3},
1015+
{1, arcs_48_3},
10171016
};
10181017
static arc arcs_49_0[7] = {
10191018
{16, 1},

0 commit comments

Comments
 (0)