]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - parser.c
update old_string after a recursive preprocess call so we don't reset to a free'd...
[xonotic/gmqcc.git] / parser.c
index 38af9a9e0dacc6997bcc9ede49a1e496fc4c3ce9..c4cdf2f89f88114af5c31d89ec3261e97bb0f475 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -3425,6 +3425,16 @@ bool parser_compile_file(const char *filename)
     return parser_compile();
 }
 
+bool parser_compile_string_len(const char *name, const char *str, size_t len)
+{
+    parser->lex = lex_open_string(str, len, name);
+    if (!parser->lex) {
+        con_err("failed to create lexer for string \"%s\"\n", name);
+        return false;
+    }
+    return parser_compile();
+}
+
 bool parser_compile_string(const char *name, const char *str)
 {
     parser->lex = lex_open_string(str, strlen(str), name);