]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - parse.c
Include now works
[xonotic/gmqcc.git] / parse.c
diff --git a/parse.c b/parse.c
index d2c90630b098ab34aac042bbf503394ecda550d8..caefc205116e5ffa715f5a84f03f335b008f0b29 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -427,6 +427,17 @@ int parse_tree(struct lex_file *file) {
                                                token = lex_token(file);
                                        if (token == '\n')
                                                return error(ERROR_PARSE, "%d: Invalid use of include preprocessor directive: wanted #include \"file.h\"\n", file->line-1);
+                                               
+                                       char            *copy = util_strdup(file->lastok);
+                                       struct lex_file *next = lex_include(file,   copy);
+                                       
+                                       if (!next) {
+                                               error(ERROR_INTERNAL, "Include subsystem failure\n");
+                                               exit (-1);
+                                       }
+                                       parse_tree(next);
+                                       mem_d     (copy);
+                                       lex_close (next);
                                }
                        
                                /* skip all tokens to end of directive */