[gobject-introspection] scanner: Parse GNUC expression statements



commit ae4fb7928cc2e311c0f2e91a7c7ac673184a2eb2
Author: Colin Walters <walters verbum org>
Date:   Wed Jun 1 18:29:35 2011 -0400

    scanner: Parse GNUC expression statements
    
    This is needed so we don't fail to parse gatomic.h from GLib.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=651548

 giscanner/scannerparser.y |    4 ++++
 tests/scanner/regress.h   |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/giscanner/scannerparser.y b/giscanner/scannerparser.y
index 6400f72..8b9ce44 100644
--- a/giscanner/scannerparser.y
+++ b/giscanner/scannerparser.y
@@ -259,6 +259,10 @@ primary_expression
 	  {
 		$$ = $2;
 	  }
+	| EXTENSION '(' '{' block_item_list '}' ')'
+	  {
+		$$ = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, lineno);
+	  }
 	;
 
 /* concatenate adjacent string literal tokens */
diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h
index f463a03..9f32640 100644
--- a/tests/scanner/regress.h
+++ b/tests/scanner/regress.h
@@ -694,4 +694,8 @@ void regress_test_struct_fixed_array_frob (RegressTestStructFixedArray *str);
 
 #define REGRESS_UTF8_CONSTANT "const \xe2\x99\xa5 utf8"
 
+#ifdef __GNUC__
+#define REGRESS_TEST_GNUC_EXTENSION_STMT(foo) (G_GNUC_EXTENSION ({ int x[10]; x[5] = 42; x[5]; }))
+#endif
+
 #endif /* __GITESTTYPES_H__ */



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