lean4-htt/library/init/meta/pexpr.lean

42 lines
1.3 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/-
Copyright (c) 2016 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
prelude
import init.meta.expr
universe u
@[reducible] def pos := nat × nat
/- Quoted expressions. They can be converted into expressions by using a tactic. -/
meta constant pexpr : Type
protected meta constant pexpr.of_expr : expr → pexpr
protected meta constant pexpr.subst : pexpr → pexpr → pexpr
/- Low level primitives for accessing internal representation. -/
protected meta constant pexpr.to_raw_expr : pexpr → expr
protected meta constant pexpr.of_raw_expr : expr → pexpr
meta constant pexpr.mk_placeholder : pexpr
meta constant pexpr.pos : pexpr → option pos
meta constant pexpr.mk_quote_macro : pexpr → pexpr
meta constant pexpr.mk_prenum_macro : nat → pexpr
meta constant pexpr.mk_string_macro : string → pexpr
meta constant pexpr.to_string : pexpr → string
meta instance : has_to_string pexpr :=
⟨pexpr.to_string⟩
meta class has_to_pexpr (α : Type u) :=
(to_pexpr : α → pexpr)
meta def to_pexpr {α : Type u} [has_to_pexpr α] : α → pexpr :=
has_to_pexpr.to_pexpr
meta instance : has_to_pexpr pexpr :=
⟨id⟩
meta instance : has_to_pexpr expr :=
⟨pexpr.of_expr⟩