From 62ac0453c49de5e4a7ac5673bd772c6484d6acf7 Mon Sep 17 00:00:00 2001 From: Teddy Date: Sat, 12 Apr 2014 23:02:31 +0800 Subject: fixed bugs in typedef (with struct/union) --- cibic.y | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cibic.y') diff --git a/cibic.y b/cibic.y index c3d65ac..66337c9 100644 --- a/cibic.y +++ b/cibic.y @@ -42,6 +42,7 @@ declaration $$ = cnode_add_loc(cnode_create_decl( $1, cnode_list_wrap(INIT_DECLRS, cnode_create_nop())), @$); + exit_declr(); } | type_specifier init_declarators ';' { $$ = cnode_add_loc(cnode_create_decl( @@ -53,6 +54,7 @@ declaration function_definition : type_specifier declarator compound_statement { $$ = cnode_add_loc(cnode_create_func($1, $2, $3), @$); + exit_declr(); } parameters @@ -115,8 +117,8 @@ struct_field } struct_or_union - : KW_STRUCT { $$ = KW_STRUCT; } - | KW_UNION { $$ = KW_UNION; } + : KW_STRUCT { $$ = KW_STRUCT; enter_struct(); } + | KW_UNION { $$ = KW_UNION; enter_struct(); } plain_declaration : type_specifier declarator { -- cgit v1.2.3-70-g09d2