]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - main.cpp
Stuff
[xonotic/gmqcc.git] / main.cpp
index 449067dec909a1225a1b8659b70f95d8fe78cea7..4b5f37608afb5c05013cb300213c8c5d41aad80f 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -3,6 +3,7 @@
 
 #include "gmqcc.h"
 #include "lexer.h"
+#include "parser.h"
 
 /* TODO: cleanup this whole file .. it's a fuckign mess */
 
@@ -697,7 +698,7 @@ int main(int argc, char **argv) {
                     }
                     data = ftepp_get(ftepp);
                     if (vec_size(data)) {
-                        if (!parser_compile_string(parser, items[itr].filename, data, vec_size(data))) {
+                        if (!parser_compile_string(*parser, items[itr].filename, data, vec_size(data))) {
                             retval = 1;
                             goto cleanup;
                         }
@@ -705,7 +706,7 @@ int main(int argc, char **argv) {
                     ftepp_flush(ftepp);
                 }
                 else {
-                    if (!parser_compile_file(parser, items[itr].filename)) {
+                    if (!parser_compile_file(*parser, items[itr].filename)) {
                         retval = 1;
                         goto cleanup;
                     }
@@ -721,7 +722,7 @@ int main(int argc, char **argv) {
         ftepp_finish(ftepp);
         ftepp = nullptr;
         if (!OPTS_OPTION_BOOL(OPTION_PP_ONLY)) {
-            if (!parser_finish(parser, OPTS_OPTION_STR(OPTION_OUTPUT))) {
+            if (!parser_finish(*parser, OPTS_OPTION_STR(OPTION_OUTPUT))) {
                 retval = 1;
                 goto cleanup;
             }
@@ -736,7 +737,7 @@ cleanup:
     vec_free(ppems);
 
     if (!OPTS_OPTION_BOOL(OPTION_PP_ONLY))
-        if(parser) parser_cleanup(parser);
+        delete parser;
 
     /* free allocated option strings */
     for (itr = 0; itr < OPTION_COUNT; itr++)