perf: make builtin_initialize backing def private (#9540)
This commit is contained in:
parent
81fe5243d3
commit
7f4d673d33
1 changed files with 4 additions and 1 deletions
|
|
@ -343,7 +343,10 @@ def elabMutual : CommandElab := fun stx => do
|
|||
| throwErrorAt declModifiers "invalid initialization command, unexpected modifiers"
|
||||
let attrs := (attrs?.map (·.getElems)).getD #[]
|
||||
let attrs := attrs.push (← `(Lean.Parser.Term.attrInstance| $attrId:ident))
|
||||
elabCommand (← `($[$doc?:docComment]? @[$[$attrs],*] $[unsafe%$unsafe?]? def initFn : IO Unit := do $doSeq))
|
||||
-- `[builtin_init]` can be private as it is used for local codegen only but `[init]` must be
|
||||
-- available for the interpreter.
|
||||
let privTk? := guard (attrId.getId == `builtin_init) *> some .missing
|
||||
elabCommand (← `($[$doc?:docComment]? @[$[$attrs],*] $[private%$privTk?]? $[unsafe%$unsafe?]? def initFn : IO Unit := do $doSeq))
|
||||
| _ => throwUnsupportedSyntax
|
||||
|
||||
builtin_initialize
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue