feat(library/init/lean/elaborator/command): elaborate init_quot command

This commit is contained in:
Leonardo de Moura 2019-08-07 17:41:18 -07:00
parent bf2a365501
commit 6e4b9f2cc1
2 changed files with 10 additions and 0 deletions

View file

@ -261,6 +261,9 @@ logError stx ("unknown declaration '" ++ toString declName ++ "'")
def getEnv : Elab Environment :=
do s ← get; pure s.env
def setEnv (env : Environment) : Elab Unit :=
modify $ fun s => { env := env, .. s }
def elabTerm (stx : Syntax) : Elab Expr :=
stx.ifNode
(fun n => do

View file

@ -179,6 +179,13 @@ fun n => do
let idsStx := n.getArg 1;
idsStx.mforArgs addUniverse
@[builtinCommandElab «init_quot»] def elabInitQuot : CommandElab :=
fun _ => do
env ← getEnv;
match env.addDecl Declaration.quotDecl with
| Except.ok env => setEnv env
| Except.error ex => logElabException (ElabException.kernel ex)
/- We just ignore Lean3 notation declaration commands. -/
@[builtinCommandElab «mixfix»] def elabMixfix : CommandElab := fun _ => pure ()
@[builtinCommandElab «reserve»] def elabReserve : CommandElab := fun _ => pure ()