2014-01-02 21:14:21 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
|
|
|
#include "kernel/kernel_exception.h"
|
2014-12-15 19:04:55 +00:00
|
|
|
#include "library/io_state_stream.h"
|
|
|
|
#include "library/generic_exception.h"
|
|
|
|
|
2014-01-02 21:14:21 +00:00
|
|
|
namespace lean {
|
|
|
|
io_state_stream const & operator<<(io_state_stream const & out, endl_class) {
|
|
|
|
out.get_stream() << std::endl;
|
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|
|
|
|
io_state_stream const & operator<<(io_state_stream const & out, expr const & e) {
|
|
|
|
options const & opts = out.get_options();
|
2014-08-01 02:54:21 +00:00
|
|
|
out.get_stream() << mk_pair(group(out.get_formatter()(e)), opts);
|
2014-01-02 21:14:21 +00:00
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|
|
|
|
io_state_stream const & operator<<(io_state_stream const & out, kernel_exception const & ex) {
|
|
|
|
options const & opts = out.get_options();
|
2014-07-10 17:32:00 +00:00
|
|
|
out.get_stream() << mk_pair(ex.pp(out.get_formatter()), opts);
|
2014-01-02 21:14:21 +00:00
|
|
|
return out;
|
|
|
|
}
|
2014-11-27 17:43:58 +00:00
|
|
|
|
2014-12-15 19:04:55 +00:00
|
|
|
io_state_stream const & operator<<(io_state_stream const & out, generic_exception const & ex) {
|
|
|
|
options const & opts = out.get_options();
|
|
|
|
out.get_stream() << mk_pair(ex.pp(out.get_formatter()), opts);
|
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|
2014-11-27 17:43:58 +00:00
|
|
|
io_state_stream const & operator<<(io_state_stream const & out, format const & f) {
|
|
|
|
options const & opts = out.get_options();
|
|
|
|
out.get_stream() << mk_pair(f, opts);
|
|
|
|
return out;
|
|
|
|
}
|
2014-01-02 21:14:21 +00:00
|
|
|
}
|