/* Copyright (c) 2013 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #pragma once #include #include #include "util/sexpr/options.h" namespace lean { class expr; class environment; class formatter { std::function m_fn; options m_options; public: formatter(options const & o, std::function const & fn):m_fn(fn), m_options(o) {} format operator()(expr const & e) const { return m_fn(e, m_options); } options const & get_options() const { return m_options; } formatter update_options(options const & o) const { return formatter(o, m_fn); } }; typedef std::function formatter_factory; std::ostream & operator<<(std::ostream & out, expr const & e); typedef std::function pp_fn; void set_print_fn(std::function const & fn); }