feat(library/init/lean/elaborator/command): elaborate init_quot command
This commit is contained in:
parent
bf2a365501
commit
6e4b9f2cc1
2 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 ()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue