From f2317c78ce69a3f80a40fecd022858c11b708989 Mon Sep 17 00:00:00 2001 From: Filleo Date: Wed, 15 May 2024 16:14:55 +0200 Subject: [PATCH] solved bug from fun def --- src/yacc/parser.y | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/yacc/parser.y b/src/yacc/parser.y index 811f222..5c15452 100644 --- a/src/yacc/parser.y +++ b/src/yacc/parser.y @@ -168,8 +168,9 @@ paramlist: paramlist '(' params ')' {AST_push_node($1, $3); $$ = $1;} | paramlist '(' ')'{$$ = $1;} | '(' params ')' {AST_NODE_PTR list = AST_new_node(AST_List, NULL); - AST_push_node(list, $2);} - | '(' ')' {$$ = AST_new_node(AST_ParamList, NULL);}; + AST_push_node(list, $2); + $$ = list;} + | '(' ')' {$$ = AST_new_node(AST_List, NULL);}; params: IOqualifyier paramdecl ',' params {AST_NODE_PTR parameter = AST_new_node(AST_Parameter, NULL); AST_push_node(parameter, $1); @@ -311,7 +312,7 @@ branchhalf: branchif { AST_NODE_PTR branch = AST_new_node(AST_Stmt, NULL); AST_push_node(branch, $1); $$ = branch; } | branchhalf branchelseif { AST_push_node($1 , $2); - $$ = $1; } + $$ = $1; }; while: KeyWhile expr '{' statementlist '}' {AST_NODE_PTR whilenode = AST_new_node(AST_While, NULL);