finished ast implementation
[swftools.git] / lib / as3 / compiler.c
index 36bb1fa..597f3b9 100644 (file)
@@ -21,6 +21,7 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
+#include "common.h"
 #include "tokenizer.h"
 #include "files.h"
 #include "parser.h"
@@ -39,6 +40,8 @@ extern int a3_parse();
 extern int as3_lex();
 extern int as3_lex_destroy();
 
+static char config_recurse = 0;
+
 void as3_setverbosity(int level)
 {
     as3_verbosity=level;
@@ -47,6 +50,12 @@ void as3_add_include_dir(char*dir)
 {
     add_include_dir(dir);
 }
+void as3_set_option(const char*key, const char*value)
+{
+    if(!strcmp(key, "recurse")) {
+        config_recurse=atoi(value);
+    }
+}
 
 static char registry_initialized = 0;
 static char parser_initialized = 0;
@@ -319,7 +328,9 @@ void as3_schedule_class(const char*package, const char*cls)
 
 void as3_schedule_class_noerror(const char*package, const char*cls)
 {
-    schedule_class(package, cls, 0);
+    if(config_recurse) {
+        schedule_class(package, cls, 0);
+    }
 }