summaryrefslogtreecommitdiff
path: root/giscanner/scannerparser.y
diff options
context:
space:
mode:
authorAndreas Rottmann <a.rottmann@gmx.at>2008-10-11 21:16:57 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-10-11 21:16:57 +0000
commit7b1e139cd77b60b37d2b1dadfe45855e7bf122e1 (patch)
treed9b67de55369591a343b5d4f6f8e5cf4a093dc1f /giscanner/scannerparser.y
parent59011ffa9f2d12cb0c087f451b5918be98d6022e (diff)
downloadgobject-introspection-7b1e139cd77b60b37d2b1dadfe45855e7bf122e1.tar.gz
Bug 555712: Struct and union issues
2008-10-09 Andreas Rottmann <a.rottmann@gmx.at> Bug 555712: Struct and union issues * giscanner/scannerparser.y (struct_declarator): Use information provided about the bit width of a field. * giscanner/transformer.py (Transformer._create_member): Pass the symbol's const_int member to the created field (it represents the bit width). * giscanner/girwriter.py (GIRWriter._write_field): Output 'bits' field attribute, if present. * giscanner/ast.py (Field): Add 'bits' member, specifying the width in bits of the field (only relevant for bitfields). * tests/*: Updated. * giscanner/transformer.py (Transformer._create_typedef_struct) (Transformer._create_typedef_union): Add calls to _create_struct() and _create_union(), respectively. This causes the scanner to generate output for fields of struct and union typedefs. * tests/*: Updated. svn path=/trunk/; revision=667
Diffstat (limited to 'giscanner/scannerparser.y')
-rw-r--r--giscanner/scannerparser.y7
1 files changed, 7 insertions, 0 deletions
diff --git a/giscanner/scannerparser.y b/giscanner/scannerparser.y
index 43a5ae0d..43635bd7 100644
--- a/giscanner/scannerparser.y
+++ b/giscanner/scannerparser.y
@@ -792,6 +792,13 @@ struct_declarator
$$ = gi_source_symbol_new (CSYMBOL_TYPE_INVALID);
}
| declarator ':' constant_expression
+ {
+ $$ = $1;
+ if ($3->const_int_set) {
+ $$->const_int_set = TRUE;
+ $$->const_int = $3->const_int;
+ }
+ }
;
enum_specifier