From 77639bb21d8b96a9548f01c4cea1a64348445bc9 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Sat, 22 Dec 2012 20:41:02 +0100 Subject: [PATCH] guard ]] with lex->flags.noops --- lexer.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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 ';': -- 2.39.2