feat: "compile" 'extern' axioms
This commit is contained in:
parent
f6e5b13591
commit
b6bb31a131
2 changed files with 3 additions and 0 deletions
|
|
@ -74,6 +74,7 @@ private def getDeclNamesForCodeGen : Declaration → List Name
|
|||
| Declaration.defnDecl { name := n, .. } => [n]
|
||||
| Declaration.mutualDefnDecl defs => defs.map fun d => d.name
|
||||
| Declaration.opaqueDecl { name := n, .. } => [n]
|
||||
| Declaration.axiomDecl { name := n, .. } => [n] -- axiom may be tagged with `@[extern ...]`
|
||||
| _ => []
|
||||
|
||||
def checkIsDefinition (env : Environment) (n : Name) : Except String Unit :=
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@ def elabAxiom (modifiers : Modifiers) (stx : Syntax) : CommandElabM Unit := do
|
|||
Term.ensureNoUnassignedMVars decl
|
||||
addDecl decl
|
||||
Term.applyAttributesAt declName modifiers.attrs AttributeApplicationTime.afterTypeChecking
|
||||
if isExtern (← getEnv) declName then
|
||||
compileDecl decl
|
||||
Term.applyAttributesAt declName modifiers.attrs AttributeApplicationTime.afterCompilation
|
||||
|
||||
/-
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue