guard ]] with lex->flags.noops
authorWolfgang Bumiller <blub@speed.at>
Sat, 22 Dec 2012 19:41:02 +0000 (20:41 +0100)
committerWolfgang Bumiller <blub@speed.at>
Sat, 22 Dec 2012 19:41:02 +0000 (20:41 +0100)
lexer.c

diff --git a/lexer.c b/lexer.c
index 17fe093..01842cc 100644 (file)
--- 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 ';':