diff options
author | Simon Feltman <sfeltman@src.gnome.org> | 2013-12-25 04:17:50 -0800 |
---|---|---|
committer | Simon Feltman <sfeltman@src.gnome.org> | 2014-01-04 13:48:27 -0800 |
commit | 9d8d159c28a482de6bdaa06f3805f65d3c55e958 (patch) | |
tree | 6a0050bae709f575b851d76710e6455cc32cc6cc /giscanner/ast.py | |
parent | 795e4bf1f3dc24380964367714ebaa76588cbf67 (diff) | |
download | gobject-introspection-9d8d159c28a482de6bdaa06f3805f65d3c55e958.tar.gz |
scanner: Fix parsing for various typedef struct orderings
Add structs parsed from C's "tag namespace" into their own cache for lookup
by typdef parsing. This fixes issues where a typedef declared after a
struct would not have a correct name. This also cleans up the need for
special casing struct tags prefixed with an underscore.
https://bugzilla.gnome.org/show_bug.cgi?id=581525
Diffstat (limited to 'giscanner/ast.py')
-rw-r--r-- | giscanner/ast.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py index bd536c63..b5b2ad71 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -859,7 +859,8 @@ class Compound(Node, Registered): gtype_name=None, get_type=None, c_symbol_prefix=None, - disguised=False): + disguised=False, + tag_name=None): Node.__init__(self, name) Registered.__init__(self, gtype_name, get_type) self.ctype = ctype @@ -871,6 +872,7 @@ class Compound(Node, Registered): self.gtype_name = gtype_name self.get_type = get_type self.c_symbol_prefix = c_symbol_prefix + self.tag_name = tag_name def add_gtype(self, gtype_name, get_type): self.gtype_name = gtype_name @@ -930,13 +932,15 @@ class Record(Compound): gtype_name=None, get_type=None, c_symbol_prefix=None, - disguised=False): + disguised=False, + tag_name=None): Compound.__init__(self, name, ctype=ctype, gtype_name=gtype_name, get_type=get_type, c_symbol_prefix=c_symbol_prefix, - disguised=disguised) + disguised=disguised, + tag_name=tag_name) # If non-None, this record defines the FooClass C structure # for some Foo GObject (or similar for GInterface) self.is_gtype_struct_for = None @@ -949,13 +953,15 @@ class Union(Compound): gtype_name=None, get_type=None, c_symbol_prefix=None, - disguised=False): + disguised=False, + tag_name=None): Compound.__init__(self, name, ctype=ctype, gtype_name=gtype_name, get_type=get_type, c_symbol_prefix=c_symbol_prefix, - disguised=disguised) + disguised=disguised, + tag_name=tag_name) class Boxed(Node, Registered): |