summaryrefslogtreecommitdiff
path: root/giscanner/ast.py
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu.duponchelle@opencreed.com>2015-07-15 13:11:45 +0200
committerMathieu Duponchelle <mathieu@centricular.com>2019-07-19 01:21:38 +0200
commit0f3efc9058e2f249e84c02840fd96b6a413a9201 (patch)
treeea4628119b6573901c3426a16a74fced1c9c7822 /giscanner/ast.py
parenta62855702c3bc0b10370ef25d622a32e227283bd (diff)
downloadgobject-introspection-0f3efc9058e2f249e84c02840fd96b6a413a9201.tar.gz
scanner: parse and expose function macros
This is useful for documentation tools, and other utilities that rely on full introspection of the C API of a given library.
Diffstat (limited to 'giscanner/ast.py')
-rw-r--r--giscanner/ast.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py
index 2daccdfb..66fe0cf1 100644
--- a/giscanner/ast.py
+++ b/giscanner/ast.py
@@ -728,6 +728,14 @@ class Callable(Node):
raise ValueError("Unknown argument %s" % (name, ))
+class FunctionMacro(Node):
+ def __init__(self, name, parameters, symbol):
+ Node.__init__(self, name)
+ self.symbol = symbol
+ self.parameters = parameters
+ self.introspectable = False
+
+
class Function(Callable):
def __init__(self, name, retval, parameters, throws, symbol):
@@ -868,7 +876,7 @@ class TypeContainer(Annotated):
self.direction = direction
if transfer is not None:
self.transfer = transfer
- elif typenode.is_const:
+ elif typenode and typenode.is_const:
self.transfer = PARAM_TRANSFER_NONE
else:
self.transfer = None