feat(frontends/lean/operator_info): add << for diagnostic and regular streams
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
90f88acf42
commit
e0eeb7c8d5
2 changed files with 14 additions and 0 deletions
|
@ -183,4 +183,14 @@ std::ostream & operator<<(std::ostream & out, operator_info const & o) {
|
|||
out << pp(o);
|
||||
return out;
|
||||
}
|
||||
|
||||
regular const & operator<<(regular const & out, operator_info const & o) {
|
||||
out.m_io_state.get_regular_channel().get_stream() << mk_pair(pp(o), out.m_io_state.get_options());
|
||||
return out;
|
||||
}
|
||||
|
||||
diagnostic const & operator<<(diagnostic const & out, operator_info const & o) {
|
||||
out.m_io_state.get_diagnostic_channel().get_stream() << mk_pair(pp(o), out.m_io_state.get_options());
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ Author: Leonardo de Moura
|
|||
#include "util/name.h"
|
||||
#include "util/list.h"
|
||||
#include "util/sexpr/format.h"
|
||||
#include "library/io_state.h"
|
||||
#include "kernel/object.h"
|
||||
|
||||
namespace lean {
|
||||
|
@ -110,6 +111,9 @@ inline operator_info mixfixo(std::initializer_list<name> const & l, unsigned pre
|
|||
format pp(operator_info const & o);
|
||||
std::ostream & operator<<(std::ostream & out, operator_info const & o);
|
||||
|
||||
regular const & operator<<(regular const & out, operator_info const & o);
|
||||
diagnostic const & operator<<(diagnostic const & out, operator_info const & o);
|
||||
|
||||
/**
|
||||
\brief Create object for tracking notation/operator declarations.
|
||||
This object is mainly used for recording the declaration.
|
||||
|
|
Loading…
Reference in a new issue