void cpp_eval(char *buf) { FILE *fp = fmemopen(buf, strlen(buf), "r"); set_input_file("(eval)", NULL, fp); List *toplevels = read_toplevels(); for (Iter *i = list_iter(toplevels); !iter_end(i);) emit_toplevel(iter_next(i)); }
void cpp_eval(char *buf) { stream_stash(make_file_string(buf)); Vector *toplevels = read_toplevels(); for (int i = 0; i < vec_len(toplevels); i++) emit_toplevel(vec_get(toplevels, i)); stream_unstash(); }
static void compile(module_t m, struct symbol_list *list) { struct symbol *sym; FOR_EACH_PTR(list, sym) { struct entrypoint *ep; expand_symbol(sym); ep = linearize_symbol(sym); if (ep) emit_function(m, ep); else emit_toplevel(m, sym); } END_FOR_EACH_PTR(sym); }