Skip to content

Commit 3ce35bf

Browse files
authored
[3.9] bpo-44385: Remove unused grammar rules (GH-26655) (GH-26659)
(cherry picked from commit e7b4644)
1 parent 304ec53 commit 3ce35bf

File tree

2 files changed

+469
-945
lines changed

2 files changed

+469
-945
lines changed

Grammar/python.gram

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,6 @@ del_t_atom[expr_ty]:
600600
| '(' a=[del_targets] ')' { _Py_Tuple(a, Del, EXTRA) }
601601
| '[' a=[del_targets] ']' { _Py_List(a, Del, EXTRA) }
602602

603-
targets[asdl_seq*]: a=','.target+ [','] { a }
604-
target[expr_ty] (memo):
605-
| a=t_primary '.' b=NAME !t_lookahead { _Py_Attribute(a, b->v.Name.id, Store, EXTRA) }
606-
| a=t_primary '[' b=slices ']' !t_lookahead { _Py_Subscript(a, b, Store, EXTRA) }
607-
| t_atom
608603
t_primary[expr_ty]:
609604
| a=t_primary '.' b=NAME &t_lookahead { _Py_Attribute(a, b->v.Name.id, Load, EXTRA) }
610605
| a=t_primary '[' b=slices ']' &t_lookahead { _Py_Subscript(a, b, Load, EXTRA) }
@@ -616,12 +611,6 @@ t_primary[expr_ty]:
616611
EXTRA) }
617612
| a=atom &t_lookahead { a }
618613
t_lookahead: '(' | '[' | '.'
619-
t_atom[expr_ty]:
620-
| a=NAME { _PyPegen_set_expr_context(p, a, Store) }
621-
| '(' a=target ')' { _PyPegen_set_expr_context(p, a, Store) }
622-
| '(' b=[targets] ')' { _Py_Tuple(b, Store, EXTRA) }
623-
| '[' b=[targets] ']' { _Py_List(b, Store, EXTRA) }
624-
625614

626615
# From here on, there are rules for invalid syntax with specialised error messages
627616
invalid_arguments:

0 commit comments

Comments
 (0)