Skip to content

Commit

Permalink
bpo-44385: Remove unused grammar rules (GH-26655)
Browse files Browse the repository at this point in the history
Automerge-Triggered-By: GH:lysnikolaou
  • Loading branch information
lysnikolaou committed Jun 10, 2021
1 parent 6544b25 commit e7b4644
Show file tree
Hide file tree
Showing 2 changed files with 791 additions and 1,267 deletions.
11 changes: 0 additions & 11 deletions Grammar/python.gram
Original file line number Diff line number Diff line change
Expand Up @@ -811,11 +811,6 @@ del_t_atom[expr_ty]:
| '(' a=[del_targets] ')' { _PyAST_Tuple(a, Del, EXTRA) }
| '[' a=[del_targets] ']' { _PyAST_List(a, Del, EXTRA) }

targets[asdl_expr_seq*]: a[asdl_expr_seq*]=','.target+ [','] { a }
target[expr_ty] (memo):
| a=t_primary '.' b=NAME !t_lookahead { _PyAST_Attribute(a, b->v.Name.id, Store, EXTRA) }
| a=t_primary '[' b=slices ']' !t_lookahead { _PyAST_Subscript(a, b, Store, EXTRA) }
| t_atom
t_primary[expr_ty]:
| a=t_primary '.' b=NAME &t_lookahead { _PyAST_Attribute(a, b->v.Name.id, Load, EXTRA) }
| a=t_primary '[' b=slices ']' &t_lookahead { _PyAST_Subscript(a, b, Load, EXTRA) }
Expand All @@ -828,12 +823,6 @@ t_primary[expr_ty]:
EXTRA) }
| a=atom &t_lookahead { a }
t_lookahead: '(' | '[' | '.'
t_atom[expr_ty]:
| a=NAME { _PyPegen_set_expr_context(p, a, Store) }
| '(' a=target ')' { _PyPegen_set_expr_context(p, a, Store) }
| '(' b=[targets] ')' { _PyAST_Tuple(b, Store, EXTRA) }
| '[' b=[targets] ']' { _PyAST_List(b, Store, EXTRA) }


# From here on, there are rules for invalid syntax with specialised error messages
invalid_arguments:
Expand Down
Loading

0 comments on commit e7b4644

Please sign in to comment.