@@ -2664,45 +2664,44 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func)
26642664 expr_ty e ;
26652665 node * chch = CHILD (ch , 0 );
26662666 if (NCH (ch ) == 1 ) {
2667- if (TYPE (chch ) == star_expr ) {
2668- /* an iterable argument unpacking */
2669- expr_ty starred ;
2667+ /* a positional argument */
2668+ if (nkeywords ) {
26702669 if (ndoublestars ) {
26712670 ast_error (c , chch ,
2672- "iterable argument unpacking follows "
2671+ "positional argument follows "
26732672 "keyword argument unpacking" );
2674- return NULL ;
26752673 }
2676- e = ast_for_expr (c , CHILD (chch , 1 ));
2677- if (!e )
2678- return NULL ;
2679- starred = Starred (e , Load , LINENO (chch ),
2680- chch -> n_col_offset ,
2681- c -> c_arena );
2682- if (!starred )
2683- return NULL ;
2684- asdl_seq_SET (args , nargs ++ , starred );
2685- }
2686- else {
2687- /* a positional argument */
2688- if (nkeywords ) {
2689- if (ndoublestars ) {
2690- ast_error (c , chch ,
2691- "positional argument follows "
2692- "keyword argument unpacking" );
2693- }
2694- else {
2695- ast_error (c , chch ,
2696- "positional argument follows "
2697- "keyword argument" );
2698- }
2699- return NULL ;
2674+ else {
2675+ ast_error (c , chch ,
2676+ "positional argument follows "
2677+ "keyword argument" );
27002678 }
2701- e = ast_for_expr (c , chch );
2702- if (!e )
2703- return NULL ;
2704- asdl_seq_SET (args , nargs ++ , e );
2679+ return NULL ;
27052680 }
2681+ e = ast_for_expr (c , chch );
2682+ if (!e )
2683+ return NULL ;
2684+ asdl_seq_SET (args , nargs ++ , e );
2685+ }
2686+ else if (TYPE (chch ) == STAR ) {
2687+ /* an iterable argument unpacking */
2688+ expr_ty starred ;
2689+ if (ndoublestars ) {
2690+ ast_error (c , chch ,
2691+ "iterable argument unpacking follows "
2692+ "keyword argument unpacking" );
2693+ return NULL ;
2694+ }
2695+ e = ast_for_expr (c , CHILD (ch , 1 ));
2696+ if (!e )
2697+ return NULL ;
2698+ starred = Starred (e , Load , LINENO (chch ),
2699+ chch -> n_col_offset ,
2700+ c -> c_arena );
2701+ if (!starred )
2702+ return NULL ;
2703+ asdl_seq_SET (args , nargs ++ , starred );
2704+
27062705 }
27072706 else if (TYPE (chch ) == DOUBLESTAR ) {
27082707 /* a keyword argument unpacking */
0 commit comments