"Label" attributes #
Allow creating attributes using register_label_attr
,
and retrieving the array of Name
s of declarations which have been tagged with such an attribute.
These differ slightly from the built-in "tag attributes" which can be initialized with the syntax:
initialize someName : TagAttribute ← registerTagAttribute `tagName "description"
in that a "tag attribute" can only be put on a declaration at the moment it is declared, and can not be modified by scoping commands.
The "label attributes" constructed here support adding (or locally removing) the attribute either at the moment of declaration, or later.
An environment extension that just tracks an array of names.
Equations
Instances For
The collection of all current LabelExtension
s, indexed by name.
Equations
Instances For
Store the current LabelExtension
s.
Helper function for registerLabelAttr
.
Equations
- Std.Tactic.LabelAttr.mkLabelExt = Lean.registerSimpleScopedEnvExtension (Lean.SimpleScopedEnvExtension.Descr.mk (fun d e => if Array.contains d e = true then d else Array.push d e) #[] id)
Instances For
Helper function for registerLabelAttr
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Construct a new "label attribute", which does nothing except keep track of the names of the declarations with that attribute.
Users will generally use the register_label_attr
macro defined below.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Initialize a new "label" attribute.
Declarations tagged with the attribute can be retrieved using Std.Tactic.LabelAttr.labelled
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
When attrName
is an attribute created using register_labelled_attr
,
return the names of all declarations labelled using that attribute.
Equations
- One or more equations did not get rendered due to their size.