3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-06 15:25:46 +00:00

add line/position information to unsupported command reports per zeph pull request

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2015-10-30 19:23:31 -07:00
parent eb2193f5ae
commit ac3edbbaaa
5 changed files with 20 additions and 12 deletions

View file

@ -205,7 +205,7 @@ UNARY_CMD(set_logic_cmd, "set-logic", "<symbol>", "set the background logic.", C
if (ctx.set_logic(arg))
ctx.print_success();
else
ctx.print_unsupported(symbol::null);
ctx.print_unsupported(symbol::null, m_line, m_pos);
);
UNARY_CMD(pp_cmd, "display", "<term>", "display the given term.", CPK_EXPR, expr *, {
@ -436,7 +436,7 @@ public:
virtual void execute(cmd_context & ctx) {
if (m_unsupported)
ctx.print_unsupported(m_option);
ctx.print_unsupported(m_option, m_line, m_pos);
else
ctx.print_success();
}
@ -472,7 +472,7 @@ public:
// print_bool(ctx, );
// }
else if (opt == m_expand_definitions) {
ctx.print_unsupported(m_expand_definitions);
ctx.print_unsupported(m_expand_definitions, m_line, m_pos);
}
else if (opt == m_interactive_mode) {
print_bool(ctx, ctx.interactive_mode());
@ -523,7 +523,7 @@ public:
ctx.regular_stream() << gparams::get_value(opt) << std::endl;
}
catch (gparams::exception ex) {
ctx.print_unsupported(opt);
ctx.print_unsupported(opt, m_line, m_pos);
}
}
}
@ -585,7 +585,7 @@ public:
ctx.display_statistics();
}
else {
ctx.print_unsupported(opt);
ctx.print_unsupported(opt, m_line, m_pos);
}
}
};

View file

@ -262,7 +262,7 @@ protected:
bool supported_logic(symbol const & s) const;
void print_unsupported_msg() { regular_stream() << "unsupported" << std::endl; }
void print_unsupported_info(symbol const& s) { if (s != symbol::null) diagnostic_stream() << "; " << s << std::endl;}
void print_unsupported_info(symbol const& s, int line, int pos) { if (s != symbol::null) diagnostic_stream() << "; " << s << " line: " << line << " position: " << pos << std::endl;}
void mk_solver();
@ -292,7 +292,7 @@ public:
void set_print_success(bool flag) { m_print_success = flag; }
bool print_success_enabled() const { return m_print_success; }
void print_success() { if (print_success_enabled()) regular_stream() << "success" << std::endl; }
void print_unsupported(symbol const & s) { print_unsupported_msg(); print_unsupported_info(s); }
void print_unsupported(symbol const & s, int line, int pos) { print_unsupported_msg(); print_unsupported_info(s, line, pos); }
bool global_decls() const { return m_global_decls; }
void set_global_decls(bool flag) { SASSERT(!has_manager()); m_global_decls = flag; }
unsigned random_seed() const { return m_random_seed; }