fix: append match_<idx> suffix only there is more than one alternative
This commit is contained in:
parent
b9a2885e65
commit
f28a7306f2
1 changed files with 2 additions and 1 deletions
|
|
@ -23,7 +23,8 @@ private def mkAuxiliaryMatchTermAux (parentTag : Name) (matchTac : Syntax) : Sta
|
|||
pure alt
|
||||
else if holeOrTacticSeq.isOfKind `Lean.Parser.Term.hole then
|
||||
let s ← get
|
||||
let holeName := mkIdentFrom holeOrTacticSeq (parentTag ++ (`match).appendIndexAfter s.nextIdx)
|
||||
let tag := if alts.size > 1 then parentTag ++ (`match).appendIndexAfter s.nextIdx else parentTag
|
||||
let holeName := mkIdentFrom holeOrTacticSeq tag
|
||||
let newHole ← `(?$holeName:ident)
|
||||
modify fun s => { s with nextIdx := s.nextIdx + 1}
|
||||
pure $ alt.setArg 2 newHole
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue