2015-07-28 00:40:56 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2015 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
|
|
|
#include "frontends/lean/opt_cmd.h"
|
|
|
|
|
|
|
|
namespace lean {
|
2015-07-28 01:42:57 +00:00
|
|
|
static options set_line_col(options const & _opts, unsigned line, unsigned col) {
|
2015-07-28 00:40:56 +00:00
|
|
|
options opts = _opts;
|
|
|
|
opts = opts.update(name("line"), line);
|
|
|
|
opts = opts.update(name("column"), col);
|
|
|
|
return opts;
|
|
|
|
}
|
|
|
|
|
2015-07-28 01:42:57 +00:00
|
|
|
static bool has_show(options const & opts, name const & kind, unsigned & line, unsigned & col) {
|
|
|
|
if (opts.get_bool(kind)) {
|
2015-07-28 00:40:56 +00:00
|
|
|
line = opts.get_unsigned("line", 0);
|
|
|
|
col = opts.get_unsigned("column", 0);
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2015-07-28 01:42:57 +00:00
|
|
|
|
|
|
|
options set_show_goal(options const & opts, unsigned line, unsigned col) {
|
|
|
|
return set_line_col(opts.update(name("show_goal"), true), line, col);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool has_show_goal(options const & opts, unsigned & line, unsigned & col) {
|
|
|
|
return has_show(opts, "show_goal", line, col);
|
|
|
|
}
|
|
|
|
|
|
|
|
options set_show_hole(options const & opts, unsigned line, unsigned col) {
|
|
|
|
return set_line_col(opts.update(name("show_hole"), true), line, col);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool has_show_hole(options const & opts, unsigned & line, unsigned & col) {
|
|
|
|
return has_show(opts, "show_hole", line, col);
|
|
|
|
}
|
2015-07-30 17:18:03 +00:00
|
|
|
|
|
|
|
options set_show_info(options const & opts, unsigned line, unsigned col) {
|
|
|
|
return set_line_col(opts.update(name("show_info"), true), line, col);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool has_show_info(options const & opts, unsigned & line, unsigned & col) {
|
|
|
|
return has_show(opts, "show_info", line, col);
|
|
|
|
}
|
|
|
|
|
|
|
|
void print_lean_info_header(std::ostream & out) {
|
|
|
|
out << "LEAN_INFORMATION\n";
|
|
|
|
}
|
|
|
|
void print_lean_info_footer(std::ostream & out) {
|
|
|
|
out << "END_LEAN_INFORMATION\n";
|
|
|
|
}
|
2015-07-28 00:40:56 +00:00
|
|
|
}
|