chore: naming convention
This commit is contained in:
parent
738987e4ff
commit
d6418299c7
3 changed files with 5 additions and 5 deletions
|
|
@ -248,7 +248,7 @@ def getKind (stx : Syntax) : SyntaxNodeKind :=
|
|||
| Syntax.atom _ v => mkNameSimple v
|
||||
| Syntax.ident _ _ _ _ => identKind
|
||||
|
||||
def updateKind (stx : Syntax) (k : SyntaxNodeKind) : Syntax :=
|
||||
def setKind (stx : Syntax) (k : SyntaxNodeKind) : Syntax :=
|
||||
match stx with
|
||||
| Syntax.node _ args => Syntax.node k args
|
||||
| _ => stx
|
||||
|
|
|
|||
|
|
@ -507,8 +507,8 @@ def elabLetDeclCore (stx : Syntax) (expectedType? : Option Expr) (useLetExpr : B
|
|||
let stxNew ← `(let x : $type := $val; match x with | $pat => $body)
|
||||
let stxNew := match useLetExpr, elabBodyFirst with
|
||||
| true, false => stxNew
|
||||
| true, true => stxNew.updateKind `Lean.Parser.Term.«let*»
|
||||
| false, true => stxNew.updateKind `Lean.Parser.Term.«let!»
|
||||
| true, true => stxNew.setKind `Lean.Parser.Term.«let*»
|
||||
| false, true => stxNew.setKind `Lean.Parser.Term.«let!»
|
||||
| false, false => unreachable!
|
||||
withMacroExpansion stx stxNew $ elabTerm stxNew expectedType?
|
||||
else if letDecl.getKind == `Lean.Parser.Term.letEqnsDecl then
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ private def mkAuxiliaryMatchTermAux (parentTag : Name) (matchTac : Syntax) : Sta
|
|||
let matchAlts := matchTac[4]
|
||||
let alts := matchAlts[1].getArgs
|
||||
let newAlts ← alts.mapSepElemsM fun alt => do
|
||||
let alt := alt.updateKind `Lean.Parser.Term.matchAlt
|
||||
let alt := alt.setKind `Lean.Parser.Term.matchAlt
|
||||
let holeOrTacticSeq := alt[2]
|
||||
if holeOrTacticSeq.isOfKind `Lean.Parser.Term.syntheticHole then
|
||||
pure alt
|
||||
|
|
@ -33,7 +33,7 @@ private def mkAuxiliaryMatchTermAux (parentTag : Name) (matchTac : Syntax) : Sta
|
|||
let newCase ← `(tactic| case $newHoleId => $holeOrTacticSeq:tacticSeq )
|
||||
modify fun s => { s with cases := s.cases.push newCase }
|
||||
pure $ alt.setArg 2 newHole
|
||||
let result := matchTac.updateKind `Lean.Parser.Term.«match»
|
||||
let result := matchTac.setKind `Lean.Parser.Term.«match»
|
||||
let result := result.setArg 4 (matchAlts.setArg 1 (mkNullNode newAlts))
|
||||
pure result
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue