feat: simplify macroArg
This commit is contained in:
parent
a98b6763ad
commit
36d508a4ce
1 changed files with 2 additions and 1 deletions
|
|
@ -59,7 +59,8 @@ def identPrec := parser! ident >> optional Syntax.precedence
|
|||
@[builtinCommandParser] def «macro_rules» := parser! "macro_rules" >> many1Indent Term.matchAlt "'match' alternatives must be indented"
|
||||
@[builtinCommandParser] def «syntax» := parser! "syntax " >> optional ("[" >> ident >> "]") >> many1 syntaxParser >> " : " >> ident
|
||||
@[builtinCommandParser] def syntaxCat := parser! "declare_syntax_cat " >> ident
|
||||
def macroArg := parser! "(" >> optional (ident >> ":") >> syntaxParser >> ")"
|
||||
def macroArgSimple := parser! ident >> ":" >> ident >> optional Syntax.precedence
|
||||
def macroArg := try (strLitPrec <|> macroArgSimple)
|
||||
@[builtinCommandParser] def «macro» := parser! "macro " >> (strLitPrec <|> identPrec) >> many macroArg >> " : " >> ident >> unicodeSymbol "⇒" "=>" >> termParser
|
||||
|
||||
end Command
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue