feat(frontends/lean/builtin_exprs): allow 'calc' expressions to be used in tactic mode

This commit is contained in:
Leonardo de Moura 2015-05-19 15:54:49 -07:00
parent 3e87f09d78
commit 5f628d5080
4 changed files with 8 additions and 1 deletions

View file

@ -234,7 +234,8 @@ static expr parse_begin_end_core(parser & p, pos_info const & pos, name const &
t = p.mk_app(get_rexact_tac_fn(), t, pos);
add_tac(t, pos);
} else if (p.curr_is_token(get_match_tk()) || p.curr_is_token(get_assume_tk()) ||
p.curr_is_token(get_take_tk()) || p.curr_is_token(get_fun_tk())) {
p.curr_is_token(get_take_tk()) || p.curr_is_token(get_fun_tk()) ||
p.curr_is_token(get_calc_tk())) {
auto pos = p.pos();
expr t = p.parse_tactic_expr_arg();
t = p.mk_app(get_exact_tac_fn(), t, pos);

View file

@ -129,6 +129,7 @@ static name const * g_postfix_tk = nullptr;
static name const * g_prefix_tk = nullptr;
static name const * g_notation_tk = nullptr;
static name const * g_call_tk = nullptr;
static name const * g_calc_tk = nullptr;
static name const * g_persistent_tk = nullptr;
static name const * g_root_tk = nullptr;
static name const * g_fields_tk = nullptr;
@ -262,6 +263,7 @@ void initialize_tokens() {
g_prefix_tk = new name{"prefix"};
g_notation_tk = new name{"notation"};
g_call_tk = new name{"call"};
g_calc_tk = new name{"calc"};
g_persistent_tk = new name{"[persistent]"};
g_root_tk = new name{"_root_"};
g_fields_tk = new name{"fields"};
@ -396,6 +398,7 @@ void finalize_tokens() {
delete g_prefix_tk;
delete g_notation_tk;
delete g_call_tk;
delete g_calc_tk;
delete g_persistent_tk;
delete g_root_tk;
delete g_fields_tk;
@ -529,6 +532,7 @@ name const & get_postfix_tk() { return *g_postfix_tk; }
name const & get_prefix_tk() { return *g_prefix_tk; }
name const & get_notation_tk() { return *g_notation_tk; }
name const & get_call_tk() { return *g_call_tk; }
name const & get_calc_tk() { return *g_calc_tk; }
name const & get_persistent_tk() { return *g_persistent_tk; }
name const & get_root_tk() { return *g_root_tk; }
name const & get_fields_tk() { return *g_fields_tk; }

View file

@ -131,6 +131,7 @@ name const & get_postfix_tk();
name const & get_prefix_tk();
name const & get_notation_tk();
name const & get_call_tk();
name const & get_calc_tk();
name const & get_persistent_tk();
name const & get_root_tk();
name const & get_fields_tk();

View file

@ -124,6 +124,7 @@ postfix postfix
prefix prefix
notation notation
call call
calc calc
persistent [persistent]
root _root_
fields fields