From 2d8d5ffaee9701955828413f844afa1b3767f748 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 11 Jan 2025 00:52:21 +0200 Subject: futher struct continuation work --- src/parser.y | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/parser.y') diff --git a/src/parser.y b/src/parser.y index c7a3a63..3808807 100644 --- a/src/parser.y +++ b/src/parser.y @@ -75,7 +75,6 @@ %token RSHIFTSELF ">>=" %token COMMA "," %token PUB "pub" -%token STRUCT "struct" %token UNION "union" %token TYPEDEF "typedef" %token IMPORT "import" @@ -778,22 +777,13 @@ struct } struct_cont - : "continue" "[" opt_type_params "]" - APPLY "[" opt_types "]" "{" opt_behaviours "}" { - /* full form */ - $$ = gen_struct_cont($5, $3, $7, $10, src_loc(@$)); - } - | "continue" "[" opt_type_params "]" ID "{" opt_behaviours "}" { - /* abbrev 1 */ - $$ = gen_struct_cont($5, $3, NULL, $7, src_loc(@$)); - } - | "continue" APPLY "[" opt_types "]" "{" opt_behaviours "}" { + : "continue" ID "[" opt_type_params "]" "{" opt_behaviours "}" { /* abbrev 2 */ - $$ = gen_struct_cont($2, NULL, $4, $7, src_loc(@$)); + $$ = gen_struct_cont($2, $4, $7, src_loc(@$)); } | "continue" ID "{" opt_behaviours "}" { /* abbrev 3 */ - $$ = gen_struct_cont($2, NULL, NULL, $4, src_loc(@$)); + $$ = gen_struct_cont($2, NULL, $4, src_loc(@$)); } alias -- cgit v1.3