summaryrefslogtreecommitdiff
path: root/Grammar
diff options
context:
space:
mode:
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/python.gram7
1 files changed, 7 insertions, 0 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index 87725b556a..7c2a8532aa 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -91,6 +91,13 @@ call_stmt[stmt_ty]:
EXTRA), EXTRA) }
simple_primary[expr_ty]:
| a=simple_primary '.' b=NAME { _Py_Attribute(a, b->v.Name.id, Load, EXTRA) }
+ | a=simple_primary b=genexp &('.'|'('|'[') { _Py_Call(a, CHECK(_PyPegen_singleton_seq(p, b)), NULL, EXTRA) }
+ | a=simple_primary '(' b=[arguments] ')' &('.'|'('|'[') {
+ _Py_Call(a,
+ (b) ? ((expr_ty) b)->v.Call.args : NULL,
+ (b) ? ((expr_ty) b)->v.Call.keywords : NULL,
+ EXTRA) }
+ | a=simple_primary '[' b=slices ']' &('.'|'('|'[') { _Py_Subscript(a, b, Load, EXTRA) }
| NAME
# NOTE: annotated_rhs may start with 'yield'; yield_expr must start with 'yield'