implemented conditional compilation
[swftools.git] / lib / as3 / main.c
index 15f856a..8a149c8 100644 (file)
@@ -35,7 +35,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 +78,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_definition(c);
+        }
+        if(!strcmp(argv[t], "-R")) {
+            as3_set_option("recurse","1");
+        }
         if(!strcmp(argv[t], "-I")) {
             as3_add_include_dir(argv[++t]);
         }