diff options
author | Philip Withnall <pwithnall@endlessos.org> | 2022-03-22 15:05:53 +0000 |
---|---|---|
committer | Philip Withnall <pwithnall@endlessos.org> | 2022-03-22 15:05:53 +0000 |
commit | 7ea7690e860a61b5b2918bf4c026425cbbfd974f (patch) | |
tree | a0b0dd8839b300ee6cca405280ad425a4d53b5d3 /giscanner | |
parent | 722cb7431bc1255b5f05d72552ece438b48d6d1b (diff) | |
download | gobject-introspection-7ea7690e860a61b5b2918bf4c026425cbbfd974f.tar.gz |
giscanner: Support function macros with zero arguments
This fixes support for macros like `G_BREAKPOINT()` or `G_DEBUG_HERE()`
in GLib.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/scannerparser.y | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/giscanner/scannerparser.y b/giscanner/scannerparser.y index c6f9f92e..09c7a5c5 100644 --- a/giscanner/scannerparser.y +++ b/giscanner/scannerparser.y @@ -1524,6 +1524,16 @@ function_macro_define gi_source_scanner_add_symbol (scanner, sym); gi_source_symbol_unref (sym); } + | function_macro '(' ')' + { + 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 = NULL; + gi_source_symbol_merge_type (sym, func); + gi_source_scanner_add_symbol (scanner, sym); + gi_source_symbol_unref (sym); + } ; object_macro_define |