Ensure the environment does not contain a declaration with name declName.
Recall that a private declaration cannot shadow a non-private one and vice-versa, although
they internally have different names.
Instances For
Declaration visibility modifier. That is, whether a declaration is public or private or inherits its visibility from the outer scope.
- regular : Visibility
- private : Visibility
- public : Visibility
Instances For
Instances For
Codegen-relevant modifiers.
- regular : ComputeKind
- meta : ComputeKind
- noncomputable : ComputeKind
Instances For
Flags and data added to declarations (eg docstrings, attributes, private, unsafe, partial, ...).
- stx : TSyntax `Lean.Parser.Command.declModifiers
Input syntax, used for adjusting declaration range (unless missing)
The docstring, if present, and whether it's Verso.
- visibility : Visibility
- isProtected : Bool
- computeKind : ComputeKind
- recKind : RecKind
- isUnsafe : Bool
Instances For
Instances For
Adds attribute attr in modifiers
Instances For
Adds attribute attr in modifiers, at the beginning
Instances For
Retrieve doc string from stx of the form (docComment)?.
Instances For
Elaborate declaration modifiers (i.e., attributes, partial, private, protected, unsafe, meta, noncomputable, doc string)
Instances For
Ensure the function has not already been declared, and apply the given visibility setting to declName.
If private, return the updated name using our internal encoding for private names.
If protected, register declName as protected in the environment.
Instances For
Instances For
Instances For
expandDeclId resulting type.
- shortName : Name
Short name for recursively referring to the declaration.
- declName : Name
Fully qualified name that will be used to name the declaration in the kernel.
Universe parameter names provided using the
universecommand and.{...}notation.The docstring, and whether it's Verso
Instances For
Given a declaration identifier (e.g., ident (".{" ident,+ "}")?) that may contain explicit universe parameters
- Ensure the new universe parameters do not shadow universe parameters declared using
universecommand. - Create the fully qualified named for the declaration using the current namespace, and given
modifiers - Create a short version for recursively referring to the declaration. Recall that the
protectedmodifier affects the generation of the short name.
The result also contains the universe parameters provided using universe command, and the .{...} notation.
This commands also stores the doc string stored in modifiers.