Skip to content

Commit e7b4644

Browse files
authoredJun 10, 2021
bpo-44385: Remove unused grammar rules (GH-26655)
Automerge-Triggered-By: GH:lysnikolaou
1 parent 6544b25 commit e7b4644

File tree

2 files changed

+791
-1267
lines changed

2 files changed

+791
-1267
lines changed
 

‎Grammar/python.gram

-11
Original file line numberDiff line numberDiff line change
@@ -811,11 +811,6 @@ del_t_atom[expr_ty]:
811811
| '(' a=[del_targets] ')' { _PyAST_Tuple(a, Del, EXTRA) }
812812
| '[' a=[del_targets] ']' { _PyAST_List(a, Del, EXTRA) }
813813

814-
targets[asdl_expr_seq*]: a[asdl_expr_seq*]=','.target+ [','] { a }
815-
target[expr_ty] (memo):
816-
| a=t_primary '.' b=NAME !t_lookahead { _PyAST_Attribute(a, b->v.Name.id, Store, EXTRA) }
817-
| a=t_primary '[' b=slices ']' !t_lookahead { _PyAST_Subscript(a, b, Store, EXTRA) }
818-
| t_atom
819814
t_primary[expr_ty]:
820815
| a=t_primary '.' b=NAME &t_lookahead { _PyAST_Attribute(a, b->v.Name.id, Load, EXTRA) }
821816
| a=t_primary '[' b=slices ']' &t_lookahead { _PyAST_Subscript(a, b, Load, EXTRA) }
@@ -828,12 +823,6 @@ t_primary[expr_ty]:
828823
EXTRA) }
829824
| a=atom &t_lookahead { a }
830825
t_lookahead: '(' | '[' | '.'
831-
t_atom[expr_ty]:
832-
| a=NAME { _PyPegen_set_expr_context(p, a, Store) }
833-
| '(' a=target ')' { _PyPegen_set_expr_context(p, a, Store) }
834-
| '(' b=[targets] ')' { _PyAST_Tuple(b, Store, EXTRA) }
835-
| '[' b=[targets] ']' { _PyAST_List(b, Store, EXTRA) }
836-
837826

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

0 commit comments

Comments
 (0)