From edd9ded23cce132f72671a7a277aece026d305fa Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Thu, 1 Nov 2012 14:20:58 +0100 Subject: [PATCH] reserve the keywords 'switch,struct,union,break,continue' - but only with std != QCC - eg. id1 uses a function named 'break' --- lexer.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lexer.c b/lexer.c index 634f90c..d5f22a3 100644 --- a/lexer.c +++ b/lexer.c @@ -991,7 +991,21 @@ int lex_do(lex_file *lex) !strcmp(v, "local") || !strcmp(v, "return") || !strcmp(v, "const")) + { lex->tok.ttype = TOKEN_KEYWORD; + } + else if (opts_standard != COMPILER_QCC) + { + /* other standards reserve these keywords */ + if (!strcmp(v, "switch") || + !strcmp(v, "struct") || + !strcmp(v, "union") || + !strcmp(v, "break") || + !strcmp(v, "continue")) + { + lex->tok.ttype = TOKEN_KEYWORD; + } + } return lex->tok.ttype; } -- 2.39.2