[gobject-introspection] giscanner: Support function macros with zero arguments



commit 7ea7690e860a61b5b2918bf4c026425cbbfd974f
Author: Philip Withnall <pwithnall endlessos org>
Date:   Tue Mar 22 15:05:53 2022 +0000

    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>

 giscanner/scannerparser.y | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]