diff options
author | Teddy <ted.sybil@gmail.com> | 2014-04-12 23:02:31 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2014-04-12 23:02:31 +0800 |
commit | 62ac0453c49de5e4a7ac5673bd772c6484d6acf7 (patch) | |
tree | 04d3f7454afe89cba087b95bffe72bc245934bad /cibic.y | |
parent | bbce3104de593c90b10778a379728f982bc3fdcb (diff) |
fixed bugs in typedef (with struct/union)
Diffstat (limited to 'cibic.y')
-rw-r--r-- | cibic.y | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 { |