add pic_compile

This commit is contained in:
Yuichi Nishiwaki
2014-01-20 16:57:39 +09:00
parent 293fef5235
commit 655eb7a3bd
6 changed files with 421 additions and 884 deletions
+410 -876
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -27,7 +27,7 @@ pic_load(pic_state *pic, const char *fn)
for (i = 0; i < n; ++i, vs = pic_cdr(pic, vs)) {
v = pic_car(pic, vs);
proc = pic_codegen(pic, v);
proc = pic_compile(pic, v);
if (proc == NULL) {
pic_error(pic, "load: compilation failure");
}
+3 -3
View File
@@ -317,7 +317,7 @@ macroexpand(pic_state *pic, pic_value expr, struct pic_senv *senv)
for (exprs = pic_cddr(pic, expr); ! pic_nil_p(exprs); exprs = pic_cdr(pic, exprs)) {
v = pic_car(pic, exprs);
proc = pic_codegen(pic, v);
proc = pic_compile(pic, v);
if (proc == NULL) {
abort();
}
@@ -364,7 +364,7 @@ macroexpand(pic_state *pic, pic_value expr, struct pic_senv *senv)
}
val = pic_cadr(pic, pic_cdr(pic, expr));
proc = pic_codegen(pic, val);
proc = pic_compile(pic, val);
if (pic->errmsg) {
printf("macroexpand error: %s\n", pic->errmsg);
abort();
@@ -406,7 +406,7 @@ macroexpand(pic_state *pic, pic_value expr, struct pic_senv *senv)
pic_error(pic, "syntax error");
}
proc = pic_codegen(pic, val);
proc = pic_compile(pic, val);
if (pic->errmsg) {
printf("macroexpand error: %s\n", pic->errmsg);
abort();