diff options
author | Ryan Lortie <desrt@desrt.ca> | 2014-04-16 11:22:32 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2014-05-06 08:15:24 -0400 |
commit | 89d51bce0feb115a1b73f32b023bfabaeec9fde1 (patch) | |
tree | bfe3ef15f2814d85bdd86cb43ca36224c8eae179 /giscanner/girparser.py | |
parent | 754f1965c08bb01b2e6440d2a6f1ab9edd6e1970 (diff) | |
download | gobject-introspection-89d51bce0feb115a1b73f32b023bfabaeec9fde1.tar.gz |
giscanner: write nullable and optional attributes
Record our internal 'nullable' and 'optional' attributes into the
written .gir file. It is now theoretically possible to express the
concept of an out parameter with a nullable type (although presently
there is no way to do this).
Modify our own internal parser (in the scanner) to understand the
newly-written attributes.
Update the expected output of the 'Regress-1.0.gir' test to account for
the new attributes.
Nothing else understands 'nullable' yet, but the girparser in the
typelib compiler already understands 'optional' and records a bit for it
in the typelib.
https://bugzilla.gnome.org/show_bug.cgi?id=660879
Diffstat (limited to 'giscanner/girparser.py')
-rw-r--r-- | giscanner/girparser.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/giscanner/girparser.py b/giscanner/girparser.py index cac166d0..b1583998 100644 --- a/giscanner/girparser.py +++ b/giscanner/girparser.py @@ -280,6 +280,8 @@ class GIRParser(object): typeval, node.attrib.get('direction') or ast.PARAM_DIRECTION_IN, node.attrib.get('transfer-ownership'), + node.attrib.get('nullable') == '1', + node.attrib.get('optional') == '1', node.attrib.get('allow-none') == '1', node.attrib.get('scope'), node.attrib.get('caller-allocates') == '1') |