Пример #1
0
static void display_error(io_state_stream const & ios, pos_info_provider const * p, unifier_exception const & ex) {
    formatter fmt = ios.get_formatter();
    options opts  = ios.get_options();
    auto j = ex.get_justification();
    display_error_pos(ios, p, j.get_main_expr());
    ios << " " << mk_pair(j.pp(fmt, p, ex.get_substitution()), opts) << endl;
}
Пример #2
0
void vm_obj_format_info::report(io_state_stream const & ios, json & record) const {
    if (!m_cache) {
        vm_state S(m_env, ios.get_options());
        scope_vm_state scope(S);
        vm_obj thunk = m_thunk.to_vm_obj();
        const_cast<vm_obj_format_info*>(this)->m_cache = to_format(S.invoke(thunk, mk_vm_unit()));
    }
    std::ostringstream ss;
    ss << mk_pair(*m_cache, ios.get_options());
    record["state"] = ss.str();
}
Пример #3
0
void hole_info_data::report(io_state_stream const & ios, json & record) const {
    type_context_old ctx = mk_type_context_for(m_state);
    interactive_report_type(ios.get_environment(), ios.get_options(), ctx.infer(m_state.main()), record);
}
Пример #4
0
 virtual void report(io_state_stream const & ios, json & record) const override {
     record["full-id"] = m_full_id.to_string();
     add_source_info(ios.get_environment(), m_full_id, record);
     if (auto doc = get_doc_string(ios.get_environment(), m_full_id))
         record["doc"] = *doc;
 }
Пример #5
0
 virtual void report(io_state_stream const & ios, json & record) const override {
     interactive_report_type(ios.get_environment(), ios.get_options(), m_expr, record);
 }
Пример #6
0
void display_pos(io_state_stream const & ios, char const * strm_name, unsigned line, unsigned pos) {
    display_pos(ios.get_stream(), ios.get_options(), strm_name, line, pos);
}