This commit is contained in:
cozis
2022-04-06 13:40:55 +02:00
parent ed63f09b57
commit 13f80915c7
3 changed files with 9 additions and 3 deletions
+2
View File
@@ -0,0 +1,2 @@
fun f() return 1, 2;
print((a, b) = f(), '\n');
+4 -3
View File
@@ -1,8 +1,9 @@
fun hello() fun hello()
return 1, "hello"; return [1, 2, 3], "hello";
a, b = hello(); print((a, b, c) = hello(), '\n');
print('a = ', a, '\n'); print('a = ', a, '\n');
print('b = ', b, '\n'); print('b = ', b, '\n');
print('c = ', c, '\n');
+3
View File
@@ -1637,6 +1637,9 @@ static Node *parse_expression_2(Context *ctx, Node *left_expr, int min_prec, _Bo
if(right_expr == NULL) if(right_expr == NULL)
return NULL; return NULL;
if(ctx->token->kind == ',' && allow_toplev_tuples == 0)
break;
} }
OperExprNode *temp; OperExprNode *temp;