diff options
author | Johan Dahlin <johan@gnome.org> | 2010-09-20 17:44:09 -0300 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2010-09-20 18:54:42 -0300 |
commit | 8398ce7b33dd9b6866795998d60e9bc7bb7090e2 (patch) | |
tree | 5f6350087bf890d3e43d472829d2e3cd8a6ca8e8 /giscanner/scannerparser.y | |
parent | 635b6ec35fbb1c2355e9b8b336f1a9164cc44034 (diff) | |
download | gobject-introspection-8398ce7b33dd9b6866795998d60e9bc7bb7090e2.tar.gz |
[scanner] Support private/public directives
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=594125
Diffstat (limited to 'giscanner/scannerparser.y')
-rw-r--r-- | giscanner/scannerparser.y | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/giscanner/scannerparser.y b/giscanner/scannerparser.y index b4df11cc..d5f9a65c 100644 --- a/giscanner/scannerparser.y +++ b/giscanner/scannerparser.y @@ -742,10 +742,12 @@ struct_or_union_specifier struct_or_union : STRUCT { + scanner->private = FALSE; $$ = gi_source_struct_new (NULL); } | UNION { + scanner->private = FALSE; $$ = gi_source_union_new (NULL); } ; @@ -771,7 +773,8 @@ struct_declaration else sym->type = CSYMBOL_TYPE_MEMBER; gi_source_symbol_merge_type (sym, gi_source_type_copy ($1)); - $$ = g_list_append ($$, sym); + sym->private = scanner->private; + $$ = g_list_append ($$, sym); } ctype_free ($1); } @@ -830,6 +833,7 @@ struct_declarator enum_specifier : ENUM identifier_or_typedef_name '{' enumerator_list '}' { + scanner->private = FALSE; $$ = gi_source_enum_new ($2); $$->child_list = $4; $$->is_bitfield = is_bitfield; @@ -837,6 +841,7 @@ enum_specifier } | ENUM '{' enumerator_list '}' { + scanner->private = FALSE; $$ = gi_source_enum_new (NULL); $$->child_list = $3; $$->is_bitfield = is_bitfield; @@ -844,6 +849,7 @@ enum_specifier } | ENUM identifier_or_typedef_name '{' enumerator_list ',' '}' { + scanner->private = FALSE; $$ = gi_source_enum_new ($2); $$->child_list = $4; $$->is_bitfield = is_bitfield; @@ -851,6 +857,7 @@ enum_specifier } | ENUM '{' enumerator_list ',' '}' { + scanner->private = FALSE; $$ = gi_source_enum_new (NULL); $$->child_list = $3; $$->is_bitfield = is_bitfield; @@ -858,6 +865,7 @@ enum_specifier } | ENUM identifier_or_typedef_name { + scanner->private = FALSE; $$ = gi_source_enum_new ($2); } ; @@ -870,11 +878,17 @@ enumerator_list } enumerator { - $$ = g_list_append (NULL, $2); + if (!scanner->private) + { + $$ = g_list_append (NULL, $2); + } } | enumerator_list ',' enumerator { - $$ = g_list_append ($1, $3); + if (!scanner->private) + { + $$ = g_list_append ($1, $3); + } } ; |