summaryrefslogtreecommitdiff
path: root/giscanner/transformer.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-09-20 17:44:09 -0300
committerJohan Dahlin <johan@gnome.org>2010-09-20 18:54:42 -0300
commit8398ce7b33dd9b6866795998d60e9bc7bb7090e2 (patch)
tree5f6350087bf890d3e43d472829d2e3cd8a6ca8e8 /giscanner/transformer.py
parent635b6ec35fbb1c2355e9b8b336f1a9164cc44034 (diff)
downloadgobject-introspection-8398ce7b33dd9b6866795998d60e9bc7bb7090e2.tar.gz
[scanner] Support private/public directives
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=594125
Diffstat (limited to 'giscanner/transformer.py')
-rw-r--r--giscanner/transformer.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py
index 70addb26..9f2bc153 100644
--- a/giscanner/transformer.py
+++ b/giscanner/transformer.py
@@ -354,6 +354,8 @@ raise ValueError."""
if prefixlen > 0:
name = child.ident[prefixlen:]
else:
+ if child.ident is None:
+ continue
# Ok, the enum members don't have a consistent prefix
# among them, so let's just remove the global namespace
# prefix.
@@ -448,7 +450,12 @@ raise ValueError."""
# ast.Fields are assumed to be read-write
# (except for Objects, see also glibtransformer.py)
node = ast.Field(symbol.ident, ftype,
- readable=True, writable=True, bits=symbol.const_int)
+ readable=True, writable=True,
+ bits=symbol.const_int)
+ if symbol.private:
+ node.readable = False
+ node.writable = False
+ node.private = True
return node
def _create_typedef(self, symbol):