feat: doc comments on anonymous initialize

This commit is contained in:
Mario Carneiro 2022-07-29 22:06:21 -04:00 committed by Sebastian Ullrich
parent 05e42b51b3
commit 323c94ef34

View file

@ -335,9 +335,9 @@ def elabMutual : CommandElab := fun stx => do
`($[unsafe%$unsafe?]? def initFn : IO $type := with_decl_name% ?$id do $doSeq
$[$doc?:docComment]? @[$attrId:ident initFn, $(attrs?.getD ∅),*] $(vis?)? opaque $id : $type)
else
let `(Parser.Command.declModifiersT| ) := declModifiers
let `(Parser.Command.declModifiersT| $[$doc?:docComment]? ) := declModifiers
| Macro.throwErrorAt declModifiers "invalid initialization command, unexpected modifiers"
`(@[$attrId:ident] def initFn : IO Unit := do $doSeq)
`($[$doc?:docComment]? @[$attrId:ident] def initFn : IO Unit := do $doSeq)
| _ => Macro.throwUnsupported
builtin_initialize