]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lexer.c
Experimental support for implicit return assignments. This closes #107. To enable...
[xonotic/gmqcc.git] / lexer.c
diff --git a/lexer.c b/lexer.c
index 6f9def80dbf103511051a1f46663360a0e3c3a21..035dc1b6d4b3577d9e2c731fe1989e951ffaf3d9 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -58,9 +58,9 @@ static size_t num_keywords_fg = sizeof(keywords_fg) / sizeof(keywords_fg[0]);
  * Lexer code
  */
 
-char* *lex_filenames;
+static char* *lex_filenames;
 
-void lexerror(lex_file *lex, const char *fmt, ...)
+static void lexerror(lex_file *lex, const char *fmt, ...)
 {
     va_list ap;
 
@@ -72,7 +72,7 @@ void lexerror(lex_file *lex, const char *fmt, ...)
     va_end(ap);
 }
 
-bool lexwarn(lex_file *lex, int warntype, const char *fmt, ...)
+static bool lexwarn(lex_file *lex, int warntype, const char *fmt, ...)
 {
     bool    r;
     lex_ctx ctx;
@@ -483,6 +483,9 @@ static bool lex_try_pragma(lex_file *lex)
     lex->line = line;
     while (ch != '\n' && ch != EOF)
         ch = lex_getch(lex);
+    vec_free(command);
+    vec_free(param);
+    vec_free(pragma);
     return true;
 
 unroll:
@@ -1232,7 +1235,7 @@ int lex_do(lex_file *lex)
             /*
             case '+':
             case '-':
-            */ 
+            */
             case '*':
             case '/':
             case '<':