lean2/src/kernel/printer.h
Leonardo de Moura d843d432d3 refactor(kernel): move printer and formatter objects to the kernel
The printer and formatter objects are not trusted code.
We moved them to the kernel to be able to provide them as an argument to the trace objects.
Another motivation is to eliminate the kernel_exception_formatter hack.
With the formatter in the kernel, we can implement the pretty printer for kernel exceptions as a virtual method.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-10-22 08:15:36 -07:00

25 lines
862 B
C++

/*
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 <iostream>
#include <utility>
#include "kernel/expr.h"
#include "kernel/context.h"
namespace lean {
std::ostream & operator<<(std::ostream & out, context const & ctx);
std::ostream & operator<<(std::ostream & out, expr const & e);
std::ostream & operator<<(std::ostream & out, std::pair<expr const &, context const &> const & p);
class object;
std::ostream & operator<<(std::ostream & out, object const & obj);
class environment;
std::ostream & operator<<(std::ostream & out, environment const & env);
}
void print(lean::expr const & a);
void print(lean::expr const & a, lean::context const & c);
void print(lean::context const & c);
void print(lean::environment const & e);