static stream_type& fct(stream_type& os, const argument_type& i) { format_base* format(get_formatter(os)); if (format) format->begin_bag(os, i); return os; }
static stream_type& fct(stream_type& os, const argument_type& atom) { format_base* format(get_formatter(os)); if (format) format->begin_atom(os, atom); else os << atom; return os; }
static stream_type& fct(stream_type& os, const argument_type& atom) { format_base* format(get_formatter(os)); if (format == 0) return os << atom.cast<typename promote<T>::type>(); format->begin_atom(os, atom); return os; }
environment check_cmd(parser & p) { expr e = p.parse_expr(); list<expr> ctx = locals_to_context(e, p); level_param_names ls = to_level_param_names(collect_univ_params(e)); level_param_names new_ls; std::tie(e, new_ls) = p.elaborate_relaxed(e, ctx); auto tc = mk_type_checker_with_hints(p.env(), p.mk_ngen(), true); expr type = tc->check(e, append(ls, new_ls)); auto reg = p.regular_stream(); formatter const & fmt = reg.get_formatter(); options opts = p.ios().get_options(); unsigned indent = get_pp_indent(opts); format r = group(format{fmt(e), space(), colon(), nest(indent, compose(line(), fmt(type)))}); reg << mk_pair(r, opts) << endl; return p.env(); }