From b00da3db7c1d7f1e16b2e0446234dc42d54b8708 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 13 Nov 2023 18:05:33 +0200 Subject: further simplification of scope concept --- src/parser.y | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/parser.y') diff --git a/src/parser.y b/src/parser.y index 236a106..6975041 100644 --- a/src/parser.y +++ b/src/parser.y @@ -570,23 +570,17 @@ type | "^" func_sign { /* still not entirely sold on this signature, but it's not terrible I * guess */ - $$ = gen_type(AST_TYPE_POINTER, NULL, NULL, NULL); - $$->_type.next = $2; + $$ = gen_type(AST_TYPE_POINTER, $2, NULL, NULL); } | "*" type { - $$ = gen_type(AST_TYPE_POINTER, NULL, NULL, NULL); - $$->_type.next = $2; + $$ = gen_type(AST_TYPE_POINTER, $2, NULL, NULL); } | "[" const_expr "]" type { - $$ = gen_type(AST_TYPE_ARR, NULL, $2, NULL); - $$->_type.next = $4; + $$ = gen_type(AST_TYPE_ARR, $2, $4, NULL); } | "typeof" expr { $$ = gen_type(AST_TYPE_TYPEOF, NULL, $2, NULL); } - | id "::" type { - $$ = gen_type(AST_TYPE_MEMBER, $1, $3, NULL); - } | "const" type { $$ = $2; } -- cgit v1.3