]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lexer.c
Keep track of the beginning of a block
[xonotic/gmqcc.git] / lexer.c
diff --git a/lexer.c b/lexer.c
index e2cf8039fd628245a15d4ac0738775500f6cf4e1..295cb5b1955b1d506f41396bc4c5acd60ffef2a5 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -820,6 +820,18 @@ static int GMQCC_WARN lex_finish_string(lex_file *lex, int quote)
             case '<':  ch = 29; break;
             case '-':  ch = 30; break;
             case '>':  ch = 31; break;
+            case '[':  ch = 16; break;
+            case ']':  ch = 17; break;
+            case '{':
+                ch = 0;
+                for (nextch = lex_getch(lex); nextch != '}'; nextch = lex_getch(lex)) {
+                    ch = ch * 10 + nextch - '0';
+                    if (nextch < '0' || nextch > '9' || ch > 255) {
+                        lexerror(lex, "bad character code");
+                        return (lex->tok.ttype = TOKEN_ERROR);
+                    }
+                }
+                break;
             case '\n':  ch = '\n'; break;
 
             default: