mirror of
https://github.com/Z3Prover/z3
synced 2025-05-08 00:05:46 +00:00
fix error messaging for parsers
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
89971e2a98
commit
92b4b9e7a7
5 changed files with 67 additions and 10 deletions
|
@ -339,6 +339,13 @@ void ast_object_ref::finalize(cmd_context & ctx) {
|
|||
ctx.m().dec_ref(m_ast);
|
||||
}
|
||||
|
||||
void stream_ref::set(std::ostream& out) {
|
||||
reset();
|
||||
m_owner = false;
|
||||
m_name = "caller-owned";
|
||||
m_stream = &out;
|
||||
}
|
||||
|
||||
void stream_ref::set(char const * name) {
|
||||
if (!name) {
|
||||
throw cmd_exception("invalid stream name");
|
||||
|
|
|
@ -128,6 +128,7 @@ public:
|
|||
stream_ref(std::string n, std::ostream & d):m_default_name(n), m_default(d), m_name(n), m_stream(&d), m_owner(false) {}
|
||||
~stream_ref() { reset(); }
|
||||
void set(char const * name);
|
||||
void set(std::ostream& strm);
|
||||
void reset();
|
||||
std::ostream & operator*() { return *m_stream; }
|
||||
char const * name() const { return m_name.c_str(); }
|
||||
|
@ -404,6 +405,7 @@ public:
|
|||
void reset_object_refs();
|
||||
void reset_user_tactics();
|
||||
void set_regular_stream(char const * name) { m_regular.set(name); }
|
||||
void set_regular_stream(std::ostream& out) { m_regular.set(out); }
|
||||
void set_diagnostic_stream(char const * name);
|
||||
virtual std::ostream & regular_stream() { return *m_regular; }
|
||||
virtual std::ostream & diagnostic_stream() { return *m_diagnostic; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue