fix: nullary attributes in new frontend

This commit is contained in:
Sebastian Ullrich 2020-06-16 21:59:40 +02:00
parent 52d966f70b
commit 4b84f8fa88

View file

@ -64,6 +64,8 @@ env ← getEnv;
unless (isAttribute env attrName) $
throwError stx ("unknown attribute [" ++ attrName ++ "]");
let args := stx.getArg 1;
-- the old frontend passes Syntax.missing for empty args, for reasons
let args := if args.getNumArgs == 0 then Syntax.missing else args;
pure { name := attrName, args := args }
def elabAttrs (stx : Syntax) : CommandElabM (Array Attribute) :=