feat: add match tactic parser
This commit is contained in:
parent
7a6effa54f
commit
d2f9f250db
1 changed files with 4 additions and 0 deletions
|
|
@ -49,6 +49,10 @@ def generalizingVars := optional (" generalizing " >> many1 ident)
|
|||
@[builtinTacticParser] def «induction» := parser! nonReservedSymbol "induction " >> majorPremise >> usingRec >> generalizingVars >> withAlts
|
||||
@[builtinTacticParser] def «cases» := parser! nonReservedSymbol "cases " >> majorPremise >> withAlts
|
||||
def withIds : Parser := optional (" with " >> many1 ident')
|
||||
|
||||
def matchAlt : Parser := group (sepBy1 termParser ", " >> darrow >> tacticParser)
|
||||
def matchAlts : Parser := withPosition $ fun pos => (optional "| ") >> sepBy1 matchAlt (checkColGe pos.column "alternatives must be indented" >> "|")
|
||||
@[builtinTacticParser] def «match» := parser! nonReservedSymbol "match " >> sepBy1 Term.matchDiscr ", " >> Term.optType >> " with " >> matchAlts
|
||||
@[builtinTacticParser] def «injection» := parser! nonReservedSymbol "injection " >> termParser >> withIds
|
||||
@[builtinTacticParser] def paren := parser! "(" >> nonEmptySeq >> ")"
|
||||
@[builtinTacticParser] def nestedTacticBlock := parser! "begin " >> seq >> "end"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue