From 26f17fa4970618375430784819daf3189661386b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Tue, 4 Dec 2018 00:00:00 +0000 Subject: 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; } -- cgit v1.2.1