fix(frontends/lean/elaborator, library/vm/vm_qexpr): add and handle as_is annotation

This commit is contained in:
Leonardo de Moura 2016-07-31 20:49:53 -07:00
parent 6d0fa806d8
commit 7ddc3c72dd
2 changed files with 4 additions and 4 deletions

View file

@ -1364,8 +1364,8 @@ static expr translate_local_name(environment const & env, local_context const &
*/
static expr translate(environment const & env, local_context const & lctx, expr const & e) {
auto fn = [&](expr const & e) {
if (is_placeholder(e) || is_by(e)) {
return some_expr(e); // ignore placeholders
if (is_placeholder(e) || is_by(e) || is_as_is(e)) {
return some_expr(e); // ignore placeholders, nested tactics and as_is terms
} else if (is_constant(e)) {
expr new_e = copy_tag(e, translate_local_name(env, lctx, const_name(e), e));
return some_expr(new_e);

View file

@ -5,6 +5,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Author: Leonardo de Moura
*/
#include "kernel/instantiate.h"
#include "library/explicit.h"
#include "library/vm/vm.h"
#include "library/vm/vm_expr.h"
@ -20,8 +21,7 @@ vm_obj qexpr_subst(vm_obj const & _e1, vm_obj const & _e2) {
}
vm_obj qexpr_of_expr(vm_obj const & e) {
// TODO(Leo): use "as_is" macro
return e;
return to_obj(mk_as_is(to_expr(e)));
}
vm_obj expr_to_string(vm_obj const &);