From: Wolfgang Bumiller Date: Sat, 22 Dec 2012 19:41:02 +0000 (+0100) Subject: guard ]] with lex->flags.noops X-Git-Tag: 0.2~12^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=77639bb21d8b96a9548f01c4cea1a64348445bc9;p=xonotic%2Fgmqcc.git guard ]] with lex->flags.noops --- diff --git a/lexer.c b/lexer.c index 17fe093..01842cc 100644 --- a/lexer.c +++ b/lexer.c @@ -1135,14 +1135,16 @@ int lex_do(lex_file *lex) return (lex->tok.ttype = TOKEN_OPERATOR); case ']': - nextch = lex_getch(lex); - if (nextch == ']') { - lex_tokench(lex, ch); - lex_tokench(lex, nextch); - lex_endtoken(lex); - return (lex->tok.ttype = TOKEN_ATTRIBUTE_CLOSE); + if (lex->flags.noops) { + nextch = lex_getch(lex); + if (nextch == ']') { + lex_tokench(lex, ch); + lex_tokench(lex, nextch); + lex_endtoken(lex); + return (lex->tok.ttype = TOKEN_ATTRIBUTE_CLOSE); + } + lex_ungetch(lex, nextch); } - lex_ungetch(lex, nextch); /* FALL THROUGH */ case ')': case ';':