git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
small bugfix in constant checking
[swftools.git]
/
lib
/
as3
/
main.c
diff --git
a/lib/as3/main.c
b/lib/as3/main.c
index
c22792f
..
15f856a
100644
(file)
--- a/
lib/as3/main.c
+++ b/
lib/as3/main.c
@@
-31,6
+31,7
@@
#include "parser.tab.h"
#include "parser.h"
#include "compiler.h"
#include "parser.tab.h"
#include "parser.h"
#include "compiler.h"
+#include "import.h"
void test_lexer(char*filename)
{
void test_lexer(char*filename)
{
@@
-61,6
+62,10
@@
int main(int argn, char*argv[])
}
filename=argv[argn-1];
}
filename=argv[argn-1];
+ as3_add_include_dir(getcwd(buf, 512));
+
+ registry_init();
+
int t=0;
for(t=1;t<argn-1;t++) {
if(!strcmp(argv[t], "-lex")) {
int t=0;
for(t=1;t<argn-1;t++) {
if(!strcmp(argv[t], "-lex")) {
@@
-73,17
+78,25
@@
int main(int argn, char*argv[])
if(!strcmp(argv[t], "-q")) {
as3_verbosity--;
}
if(!strcmp(argv[t], "-q")) {
as3_verbosity--;
}
+ if(!strcmp(argv[t], "-I")) {
+ as3_add_include_dir(argv[++t]);
+ }
+ if(!strcmp(argv[t], "-l")) {
+ as3_import_file(argv[++t]);
+ }
}
//extern int avm2_debug;
//avm2_debug = 1;
}
//extern int avm2_debug;
//avm2_debug = 1;
-
- as3_add_include_dir(getcwd(buf, 512));
//memfile_t*m = memfile_open(filename);
//as3_parse_bytearray(filename, m->data, m->len);
//memfile_close(m);
//memfile_t*m = memfile_open(filename);
//as3_parse_bytearray(filename, m->data, m->len);
//memfile_close(m);
- as3_parse_file(filename);
+ if(!strcmp(filename, ".")) {
+ as3_parse_directory(".");
+ } else {
+ as3_parse_file(filename);
+ }
void*code = as3_getcode();
void*code = as3_getcode();