[gobject-introspection/gnome-3-30] scanner: Replace use of typeof with void token



commit 26f17fa4970618375430784819daf3189661386b
Author: Tomasz Miąsko <tomasz miasko gmail com>
Date:   Tue Dec 4 00:00:00 2018 +0000

    scanner: Replace use of typeof with void token
    
    This makes it possible to parse inputs where typeof is used as part of
    cast expression, e.g., in g_object_ref macro expansion. Selection of
    VOID is arbitrary since there is no actual implementation of typeof.

 giscanner/scannerlexer.l | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/giscanner/scannerlexer.l b/giscanner/scannerlexer.l
index 6e2796ab..971b3a73 100644
--- a/giscanner/scannerlexer.l
+++ b/giscanner/scannerlexer.l
@@ -177,8 +177,8 @@ stringtext                          ([^\\\"])|(\\.)
 "__restrict__"                         { return RESTRICT; }
 "thread_local"                         { return THREAD_LOCAL; }
 "_Thread_local"                                { return THREAD_LOCAL; }
-"__typeof__"                           { if (!parse_ignored_macro()) REJECT; }
-"__typeof"                             { if (!parse_ignored_macro()) REJECT; }
+"__typeof__"                           { if (parse_ignored_macro()) return VOID; else REJECT; }
+"__typeof"                             { if (parse_ignored_macro()) return VOID; else REJECT; }
 "__volatile"                           { return VOLATILE; }
 "__volatile__"                         { return VOLATILE; }
 "_Bool"                                        { return BASIC_TYPE; }


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