summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2018-12-04 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2018-12-04 09:15:00 +0100
commitdca00682baa25bc71f6dfbd3c207693bbcc36759 (patch)
treecadea22367d893fe64d075d1327c3753d75b0096 /giscanner
parent33e0995a28a9b83522578e701147224bf04d9630 (diff)
downloadgobject-introspection-dca00682baa25bc71f6dfbd3c207693bbcc36759.tar.gz
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.
Diffstat (limited to 'giscanner')
-rw-r--r--giscanner/scannerlexer.l4
1 files 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; }