[gobject-introspection: 1/2] scanner: Replace use of typeof with void token
- From: Christoph Reiter 🐍 <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection: 1/2] scanner: Replace use of typeof with void token
- Date: Thu, 6 Dec 2018 18:40:50 +0000 (UTC)
commit dca00682baa25bc71f6dfbd3c207693bbcc36759
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]