feat: generalize tactic/command macro syntax
This commit is contained in:
parent
cfd1900625
commit
b3d2e51aff
1 changed files with 2 additions and 2 deletions
|
|
@ -70,8 +70,8 @@ def macroArgType := nonReservedSymbol "ident" <|> nonReservedSymbol "num" <|>
|
|||
def macroArgSimple := parser! ident >> checkNoWsBefore "no space before ':'" >> ":" >> macroArgType
|
||||
def macroArg := try strLit <|> try macroArgSimple
|
||||
def macroHead := macroArg <|> try ident
|
||||
def macroTailTactic : Parser := try (" : " >> identEq "tactic") >> darrow >> "`(" >> sepBy1 tacticParser "; " true true >> ")"
|
||||
def macroTailCommand : Parser := try (" : " >> identEq "command") >> darrow >> "`(" >> many1 commandParser true >> ")"
|
||||
def macroTailTactic : Parser := try (" : " >> identEq "tactic") >> darrow >> ("`(" >> sepBy1 tacticParser "; " true true >> ")" <|> termParser)
|
||||
def macroTailCommand : Parser := try (" : " >> identEq "command") >> darrow >> ("`(" >> many1 commandParser true >> ")" <|> termParser)
|
||||
def macroTailDefault : Parser := try (" : " >> ident) >> darrow >> (("`(" >> categoryParserOfStack 2 >> ")") <|> termParser)
|
||||
def macroTail := macroTailTactic <|> macroTailCommand <|> macroTailDefault
|
||||
@[builtinCommandParser] def «macro» := parser! "macro " >> optPrecedence >> macroHead >> many macroArg >> macroTail
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue