summaryrefslogtreecommitdiff
path: root/giscanner/transformer.py
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2018-02-10 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2019-01-10 17:34:28 +0100
commitf606183a010fbec4382acb728882cc0eddbaf7f7 (patch)
treea94577a1c4baff25753e78896d700cd71797437f /giscanner/transformer.py
parent0b6bca5d69cc0f5e5564a2858f220fac8ee4789e (diff)
downloadgobject-introspection-f606183a010fbec4382acb728882cc0eddbaf7f7.tar.gz
Restore original meaning of disguised attribute.
> Certain types like GIConv and GdkAtom are pointers internally but don't > look like pointers when referenced. They have the form. > > typedef struct _X *X; > > Parse these as structures/records but mark them in the gir with a 'disguised' > attribute so that we know that they need special handling. Additionally, stop relaying on disguised attribute when deciding whether to render a page. Check number of fields instead, so as to avoid introducing large regression in the docs. Fixes #101.
Diffstat (limited to 'giscanner/transformer.py')
-rw-r--r--giscanner/transformer.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index 9911de70..4f3abcf4 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -822,13 +822,7 @@ 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 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:
+ if not tag_name:
# 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
@@ -844,10 +838,6 @@ 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)