summaryrefslogtreecommitdiff
path: root/giscanner/maintransformer.py
diff options
context:
space:
mode:
Diffstat (limited to 'giscanner/maintransformer.py')
-rw-r--r--giscanner/maintransformer.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py
index 5f4788a3..90b702d8 100644
--- a/giscanner/maintransformer.py
+++ b/giscanner/maintransformer.py
@@ -27,7 +27,7 @@ from .annotationparser import (ANN_ALLOW_NONE, ANN_ARRAY, ANN_ATTRIBUTES, ANN_CL
ANN_GET_VALUE_FUNC, ANN_IN, ANN_INOUT, ANN_METHOD, ANN_OUT,
ANN_REF_FUNC, ANN_RENAME_TO, ANN_SCOPE, ANN_SET_VALUE_FUNC,
ANN_SKIP, ANN_TRANSFER, ANN_TYPE, ANN_UNREF_FUNC, ANN_VALUE,
- ANN_VFUNC)
+ ANN_VFUNC, ANN_NULLABLE, ANN_OPTIONAL)
from .annotationparser import (OPT_ARRAY_FIXED_SIZE, OPT_ARRAY_LENGTH, OPT_ARRAY_ZERO_TERMINATED,
OPT_OUT_CALLEE_ALLOCATES, OPT_OUT_CALLER_ALLOCATES,
OPT_TRANSFER_FLOATING, OPT_TRANSFER_NONE)
@@ -579,6 +579,12 @@ class MainTransformer(object):
self._adjust_container_type(parent, node, annotations)
+ if ANN_NULLABLE in annotations:
+ node.nullable = True
+
+ if ANN_OPTIONAL in annotations:
+ node.optional = True
+
if ANN_ALLOW_NONE in annotations:
if node.direction == ast.PARAM_DIRECTION_OUT:
node.optional = True