diff --git a/Makefile b/Makefile index 50040c41..fa9f2971 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ build: cd src; \ yacc -d parse.y; \ lex scan.l - gcc -o bin/picrin -I./include src/main.c src/state.c src/gc.c src/pair.c src/write.c src/symbol.c src/value.c src/y.tab.c src/lex.yy.c src/eval.c src/bool.c + gcc -o bin/picrin -I./include src/main.c src/state.c src/gc.c src/pair.c src/write.c src/symbol.c src/value.c src/y.tab.c src/lex.yy.c src/eval.c src/bool.c src/vm.c test-vm: cd src; \ diff --git a/src/main.c b/src/main.c index 15b28450..a14e4452 100644 --- a/src/main.c +++ b/src/main.c @@ -33,6 +33,7 @@ main() char line[LINE_MAX_LENGTH], last_char; int char_index; pic_value v; + struct pic_proc *proc; pic = pic_open(); @@ -54,7 +55,10 @@ main() /* echo */ v = pic_parse(pic, line); - pic_debug(pic, pic_eval(pic, v, pic->global_env)); + //pic_debug(pic, pic_eval(pic, v, pic->global_env)); + proc = pic_codegen(pic, v, pic->global_env); + v = pic_run(pic, proc, pic_nil_value()); + pic_debug(pic, v); printf("\n"); } diff --git a/src/vm.c b/src/vm.c index 51dabcc9..eb7deff4 100644 --- a/src/vm.c +++ b/src/vm.c @@ -138,6 +138,7 @@ pic_codegen(pic_state *pic, pic_value obj, struct pic_env *env) return proc; } +#if 0 int main() { @@ -164,3 +165,4 @@ main() return 0; } +#endif