summaryrefslogtreecommitdiff
path: root/giscanner/scannerparser.y
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/scannerparser.y
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/scannerparser.y')
-rw-r--r--giscanner/scannerparser.y9
1 files changed, 9 insertions, 0 deletions
diff --git a/giscanner/scannerparser.y b/giscanner/scannerparser.y
index 29d98b41..6a2ffc1d 100644
--- a/giscanner/scannerparser.y
+++ b/giscanner/scannerparser.y
@@ -1500,6 +1500,15 @@ object_macro
function_macro_define
: function_macro '(' identifier_list ')'
+ {
+ GISourceSymbol *sym = gi_source_symbol_new (CSYMBOL_TYPE_FUNCTION_MACRO, scanner->current_file, lineno);
+ GISourceType *func = gi_source_function_new ();
+ sym->ident = g_strdup ($1);
+ func->child_list = $3;
+ gi_source_symbol_merge_type (sym, func);
+ gi_source_scanner_add_symbol (scanner, sym);
+ gi_source_symbol_unref (sym);
+ }
;
object_macro_define