summaryrefslogtreecommitdiff
path: root/giscanner/transformer.py
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2019-01-16 19:03:21 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2019-01-16 19:03:27 +0100
commit0e0ee273e7dcb6f08b4e433fdbdf11e3cffd66d1 (patch)
tree300b4bab7fdfac2c62674cdf020787a55fe52c1e /giscanner/transformer.py
parent361aa17c5302d5d9501b71ec352b39452dea6d23 (diff)
downloadgobject-introspection-0e0ee273e7dcb6f08b4e433fdbdf11e3cffd66d1.tar.gz
Revert "Restore original meaning of disguised attribute."
This reverts commit f606183a010fbec4382acb728882cc0eddbaf7f7. See https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/9#note_409979
Diffstat (limited to 'giscanner/transformer.py')
-rw-r--r--giscanner/transformer.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index 4f3abcf4..9911de70 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -822,7 +822,13 @@ raise ValueError."""
# by it being returned to the "parse" function and are also added to
# the tag namespace if it has a tag_name set.
compound = compound_class(name, symbol.ident, disguised=disguised, tag_name=tag_name)
- if not tag_name:
+ if tag_name:
+ # Force the struct as disguised for now since we do not yet know
+ # if it has fields that will be parsed. Note that this is using
+ # an erroneous definition of disguised and we should eventually
+ # only look at the field count when needed.
+ compound.disguised = True
+ else:
# Case where we have an anonymous struct which is typedef'd:
# typedef struct {...} Struct;
# we need to parse the fields because we never get a struct
@@ -838,6 +844,10 @@ raise ValueError."""
compound = self._tag_ns[symbol.ident]
else:
compound = compound_class(None, symbol.ident, tag_name=symbol.ident)
+
+ # Make sure disguised is False as we are now about to parse the
+ # fields of the real struct.
+ compound.disguised = False
# Fields may need to be parsed in either of the above cases because the
# Record can be created with a typedef prior to the struct definition.
self._parse_fields(symbol, compound)