@@ -707,12 +707,12 @@ class_def
707
707
$$ = CLASS_01($1, $3, $5, @$); }
708
708
| decorators_opt KW_CLASS id "(" expr_list_opt ")" ":" body_stmts {
709
709
$$ = CLASS_02($1, $3, $5, $8, @$); }
710
- | decorators_opt KW_CLASS id "(" expr_list "," keyword_items ")"
711
- ":" body_stmts { $$ = CLASS_03($1, $3, $5, $7, $10 , @$); }
710
+ | decorators_opt KW_CLASS id "(" expr_list "," keyword_items comma_opt ")"
711
+ ":" body_stmts { $$ = CLASS_03($1, $3, $5, $7, $11 , @$); }
712
712
| decorators_opt KW_CLASS id "(" keyword_items "," expr_list ")"
713
713
":" body_stmts { $$ = CLASS_03($1, $3, $7, $5, $10, @$); }
714
- | decorators_opt KW_CLASS id "(" keyword_items ")" ":" body_stmts {
715
- $$ = CLASS_04($1, $3, $5, $8 , @$); }
714
+ | decorators_opt KW_CLASS id "(" keyword_items comma_opt ")" ":" body_stmts
715
+ { $$ = CLASS_04($1, $3, $5, $9 , @$); }
716
716
;
717
717
718
718
async_func_def
@@ -770,7 +770,7 @@ while_statement
770
770
;
771
771
772
772
expr_list_opt
773
- : expr_list { $$ = $1; }
773
+ : expr_list comma_opt { $$ = $1; }
774
774
| %empty { LIST_NEW($$); }
775
775
;
776
776
@@ -997,13 +997,17 @@ expr
997
997
| KW_NONE { $$ = NONE(@$); }
998
998
| TK_ELLIPSIS { $$ = ELLIPSIS(@$); }
999
999
| "(" expr ")" { $$ = $2; }
1000
+ | "(" TK_TYPE_IGNORE expr ")" { $$ = $3; extract_type_comment(p, @$, $2); }
1000
1001
| "(" ")" { $$ = TUPLE_EMPTY(@$); }
1001
1002
| "(" expr_list "," ")" { $$ = TUPLE_03($2, @$); }
1003
+ | "(" TK_TYPE_IGNORE expr_list "," ")" { $$ = TUPLE_03($3, @$);
1004
+ extract_type_comment(p, @$, $2); }
1002
1005
| "(" expr_list "," expr ")" { $$ = TUPLE_01(TUPLE_($2, $4), @$); }
1006
+ | "(" TK_TYPE_IGNORE expr_list "," expr ")" {
1007
+ $$ = TUPLE_01(TUPLE_($3, $5), @$); extract_type_comment(p, @$, $2);}
1003
1008
| function_call { $$ = $1; }
1004
1009
| subscript { $$ = $1; }
1005
1010
| "[" expr_list_opt "]" { $$ = LIST($2, @$); }
1006
- | "[" expr_list "," "]" { $$ = LIST($2, @$); }
1007
1011
| "{" expr_list "}" { $$ = SET($2, @$); }
1008
1012
| "{" expr_list "," "}" { $$ = SET($2, @$); }
1009
1013
| expr "." id { $$ = ATTRIBUTE_REF($1, $3, @$); }
0 commit comments