finished ast implementation
[swftools.git] / lib / as3 / main.c
index 15f856a..0078e07 100644 (file)
@@ -27,6 +27,7 @@
 #include "../rfxswf.h"
 #include "../os.h"
 #include "files.h"
+#include "common.h"
 #include "tokenizer.h"
 #include "parser.tab.h"
 #include "parser.h"
@@ -35,7 +36,7 @@
 
 void test_lexer(char*filename)
 {
-    char*fullfilename = find_file(filename);
+    char*fullfilename = find_file(filename, 1);
     enter_file(filename, fullfilename, 0);
     FILE*fi = fopen(fullfilename, "rb");
     as3_file_input(fi);
@@ -78,6 +79,15 @@ int main(int argn, char*argv[])
         if(!strcmp(argv[t], "-q")) {
             as3_verbosity--;
         }
+        if(!strcmp(argv[t], "-D")) {
+            char*c = argv[t+1];
+            if(!strstr(c, "::"))
+                printf("Error: compile definition must contain \"::\"\n");
+            as3_set_define(c);
+        }
+        if(!strcmp(argv[t], "-R")) {
+            as3_set_option("recurse","1");
+        }
         if(!strcmp(argv[t], "-I")) {
             as3_add_include_dir(argv[++t]);
         }