]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - parser.c
better handlign of a too early error condition
[xonotic/gmqcc.git] / parser.c
index 4f5b7be4e9594c40b07f63d13954caedab82d552..21a944bdf36c6c8e6d098bcf999bcaf3048a9aae 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -2685,12 +2685,17 @@ bool parser_compile(const char *filename)
                 if (parser->tok == TOKEN_EOF)
                     parseerror(parser, "unexpected eof");
                 else if (!parser->errors)
-                    parseerror(parser, "parse error\n");
+                    parseerror(parser, "parse error");
                 lex_close(parser->lex);
                 parser->lex = NULL;
                 return false;
             }
         }
+    } else {
+        parseerror(parser, "parse error");
+        lex_close(parser->lex);
+        parser->lex = NULL;
+        return false;
     }
 
     lex_close(parser->lex);