diff options
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/ast.py | 1 | ||||
-rw-r--r-- | giscanner/girwriter.py | 2 | ||||
-rw-r--r-- | giscanner/transformer.py | 2 |
3 files changed, 5 insertions, 0 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py index 80d5f968..ca5e66d5 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -142,6 +142,7 @@ class Parameter(Node): self.type = typenode self.direction = PARAM_DIRECTION_IN self.transfer = False + self.allow_none = False def __repr__(self): return 'Parameter(%r, %r)' % (self.name, self.type) diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py index 389c05fa..af297e79 100644 --- a/giscanner/girwriter.py +++ b/giscanner/girwriter.py @@ -110,6 +110,8 @@ class GIRWriter(XMLWriter): if parameter.transfer: attrs.append(('transfer-ownership', str(int(parameter.transfer)))) + if parameter.allow_none: + attrs.append(('allow-none', '1')) with self.tagcontext('parameter', attrs): self._write_type(parameter.type) diff --git a/giscanner/transformer.py b/giscanner/transformer.py index 5a6b021b..6f7e2a35 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -221,6 +221,8 @@ class Transformer(object): param.direction = 'out' elif option == 'callee-owns': param.transfer = True + elif option == 'allow-none': + param.allow_none = True else: print 'Unhandled parameter annotation option: %s' % ( option,) |