@@ -543,25 +543,30 @@ _make_posargs(Parser *p,
543
543
asdl_arg_seq * plain_names ,
544
544
asdl_seq * names_with_default ,
545
545
asdl_arg_seq * * posargs ) {
546
- if (plain_names != NULL && names_with_default != NULL ) {
547
- asdl_arg_seq * names_with_default_names = _get_names (p , names_with_default );
548
- if (!names_with_default_names ) {
549
- return -1 ;
546
+
547
+ if (names_with_default != NULL ) {
548
+ if (plain_names != NULL ) {
549
+ asdl_arg_seq * names_with_default_names = _get_names (p , names_with_default );
550
+ if (!names_with_default_names ) {
551
+ return -1 ;
552
+ }
553
+ * posargs = (asdl_arg_seq * )_PyPegen_join_sequences (
554
+ p ,(asdl_seq * )plain_names , (asdl_seq * )names_with_default_names );
555
+ }
556
+ else {
557
+ * posargs = _get_names (p , names_with_default );
550
558
}
551
- * posargs = (asdl_arg_seq * )_PyPegen_join_sequences (
552
- p ,(asdl_seq * )plain_names , (asdl_seq * )names_with_default_names );
553
- }
554
- else if (plain_names == NULL && names_with_default != NULL ) {
555
- * posargs = _get_names (p , names_with_default );
556
- }
557
- else if (plain_names != NULL && names_with_default == NULL ) {
558
- // With the current grammar, we never get here.
559
- // If that has changed, remove the assert, and test thoroughly.
560
- assert (0 );
561
- * posargs = plain_names ;
562
559
}
563
560
else {
564
- * posargs = _Py_asdl_arg_seq_new (0 , p -> arena );
561
+ if (plain_names != NULL ) {
562
+ // With the current grammar, we never get here.
563
+ // If that has changed, remove the assert, and test thoroughly.
564
+ assert (0 );
565
+ * posargs = plain_names ;
566
+ }
567
+ else {
568
+ * posargs = _Py_asdl_arg_seq_new (0 , p -> arena );
569
+ }
565
570
}
566
571
return * posargs == NULL ? -1 : 0 ;
567
572
}
0 commit comments