示例#1
0
文件: cpp.c 项目: zhuzhaoyuan/8cc
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));
}
示例#2
0
文件: cpp.c 项目: ctx2002/8cc
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();
}