コード例 #1
0
ファイル: vm_format.cpp プロジェクト: fpvandoorn/lean
vm_obj scope_trace(vm_obj const &, vm_obj const & line, vm_obj const & col, vm_obj const & fn) {
    pos_info_provider * pip = get_pos_info_provider();
    if (pip) {
        scope_traces_as_messages traces_as_messages(pip->get_file_name(), pos_info(force_to_unsigned(line), force_to_unsigned(col)));
        return invoke(fn, mk_vm_unit());
    } else {
        return invoke(fn, mk_vm_unit());
    }
}
コード例 #2
0
ファイル: parser_bindings.cpp プロジェクト: bmalehorn/lean
static int pos_of(lua_State * L) {
    int nargs = lua_gettop(L);
    pos_info pos;
    if (nargs == 1)
        pos = gparser.pos_of(to_expr(L, 1));
    else
        pos = gparser.pos_of(to_expr(L, 1), pos_info(lua_tointeger(L, 2), lua_tointeger(L, 3)));
    push_integer(L, pos.first);
    push_integer(L, pos.second);
    return 2;
}
コード例 #3
0
ファイル: parser_bindings.cpp プロジェクト: bmalehorn/lean
static int lambda_abstract(lua_State * L) {
    int nargs = lua_gettop(L);
    local_scope const & s = to_local_scope(L, 1);
    expr const & e = to_expr(L, 2);
    expr r;
    bool using_cache = false;
    if (nargs == 2)
        r = gparser.rec_save_pos(Fun(s->second.size(), s->second.data(), e, using_cache), gparser.pos_of(e));
    else
        r = gparser.rec_save_pos(Fun(s->second.size(), s->second.data(), e, using_cache), pos_info(lua_tointeger(L, 3), lua_tointeger(L, 4)));
    return push_expr(L, r);
}
コード例 #4
0
ファイル: parser_bindings.cpp プロジェクト: bmalehorn/lean
static int save_pos(lua_State * L) {
    return push_expr(L, gparser.save_pos(to_expr(L, 1), pos_info(lua_tointeger(L, 2), lua_tointeger(L, 3))));
}