A builder for attributes that are applied to declarations of a common type and
group them by the given attribute argument (an arbitrary Name
, currently).
Also creates a second "builtin" attribute used for bootstrapping, which saves
the applied declarations in an IO.Ref
instead of an environment extension.
Used to register elaborators, macros, tactics, and delaborators.
Equations
Builtin attribute name, if any (e.g., `builtin_term_elab)
builtinName : Lean.NameAttribute name (e.g., `term_elab)
name : Lean.NameAttribute description
descr : String- valueTypeName : Lean.Name
Convert
Syntax
into aKey
, the default implementation expects an identifier.evalKey : Bool → Lean.Syntax → Lean.AttrM Lean.KeyedDeclsAttribute.Key- onAdded : Bool → Lean.Name → Lean.AttrM Unit
KeyedDeclsAttribute
definition.
Important: mkConst valueTypeName
and γ
must be definitionally equal.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Name of a declaration stored in the environment which has type
mkConst Def.valueTypeName
.declName : Lean.Name
Instances For
Equations
- Lean.KeyedDeclsAttribute.instInhabitedOLeanEntry = { default := { key := default, declName := default } }
Recall that we cannot store
γ
into .olean files because it is a closure. GivenOLeanEntry.declName
, we convert it into aγ
by using the unsafe functionevalConstCheck
.value : γ
Instances For
- newEntries : List Lean.KeyedDeclsAttribute.OLeanEntry
- table : Lean.KeyedDeclsAttribute.Table γ
- declNames : Lean.PHashSet Lean.Name
- erased : Lean.PHashSet Lean.Name
Instances For
Equations
- Lean.KeyedDeclsAttribute.instInhabitedExtensionState = { default := { newEntries := default, table := default, declNames := default, erased := default } }
- defn : Lean.KeyedDeclsAttribute.Def γ
- tableRef : IO.Ref (Lean.KeyedDeclsAttribute.Table γ)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Retrieve entries tagged with [attr key]
or [builtinAttr key]
.
Equations
- One or more equations did not get rendered due to their size.
Retrieve values tagged with [attr key]
or [builtinAttr key]
.
Equations
- Lean.KeyedDeclsAttribute.getValues attr env key = List.map Lean.KeyedDeclsAttribute.AttributeEntry.value (Lean.KeyedDeclsAttribute.getEntries attr env key)