refactor: polymorphic elabAttrs and elabAttr
This commit is contained in:
parent
524eca4d7f
commit
a413da856f
1 changed files with 2 additions and 2 deletions
|
|
@ -63,7 +63,7 @@ instance Modifiers.hasFormat : HasFormat Modifiers :=
|
|||
|
||||
instance Modifiers.hasToString : HasToString Modifiers := ⟨toString ∘ format⟩
|
||||
|
||||
def elabAttr (stx : Syntax) : CommandElabM Attribute := do
|
||||
def elabAttr {m} [Monad m] [MonadEnv m] [MonadError m] (stx : Syntax) : m Attribute := do
|
||||
-- rawIdent >> many attrArg
|
||||
let nameStx := stx.getArg 0;
|
||||
attrName ← match nameStx.isIdOrAtom? with
|
||||
|
|
@ -77,7 +77,7 @@ let args := stx.getArg 1;
|
|||
let args := if args.getNumArgs == 0 then Syntax.missing else args;
|
||||
pure { name := attrName, args := args }
|
||||
|
||||
def elabAttrs (stx : Syntax) : CommandElabM (Array Attribute) :=
|
||||
def elabAttrs {m} [Monad m] [MonadEnv m] [MonadError m] (stx : Syntax) : m (Array Attribute) :=
|
||||
(stx.getArg 1).foldSepArgsM
|
||||
(fun stx attrs => do
|
||||
attr ← elabAttr stx;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue