diff options
author | Teddy <ted.sybil@gmail.com> | 2014-03-25 21:50:31 +0800 |
---|---|---|
committer | Teddy <ted.sybil@gmail.com> | 2014-03-25 21:50:31 +0800 |
commit | e9c783cec3496c3b84681ce162f6133bec8a709d (patch) | |
tree | fa1063ba1eb69cd3e560c69f0bc9e6368b4a90ce /cibic.y | |
parent | bebc7300ad6987e76db8fca785a83123ba08a927 (diff) |
fixed bugs: str and char const recogn; fields wrapping
Diffstat (limited to 'cibic.y')
-rw-r--r-- | cibic.y | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,6 @@ %{ #include <stdio.h> +#include <stdlib.h> #include "ast.h" %} %union { @@ -83,10 +84,10 @@ type_specifier | KW_CHAR { $$ = cnode_add_loc(cnode_create_type_spec(KW_CHAR, 0), @$); } | KW_INT { $$ = cnode_add_loc(cnode_create_type_spec(KW_INT, 0), @$); } | struct_or_union identifier '{' struct_fields '}' { - $$ = cnode_add_loc(cnode_create_type_spec($1, 2, $2, cnode_add_loc($4, @4)), @$); + $$ = cnode_add_loc(cnode_create_type_spec($1, 2, $2, cnode_add_loc(cnode_list_wrap(FIELDS, $4), @4)), @$); } | struct_or_union '{' struct_fields '}' { - $$ = cnode_add_loc(cnode_create_type_spec($1, 2, cnode_create_nop(), cnode_add_loc($3, @3)), @$); + $$ = cnode_add_loc(cnode_create_type_spec($1, 2, cnode_create_nop(), cnode_add_loc(cnode_list_wrap(FIELDS, $3), @3)), @$); } | struct_or_union identifier { $$ = cnode_add_loc(cnode_create_type_spec($1, 2, $2, cnode_create_nop()), @$); |