chore: use ``-prefixed Names when possible (#9217)

This commit is contained in:
Cameron Zwarich 2025-07-06 05:58:13 -07:00 committed by GitHub
parent 1443982924
commit bd7e6c3c61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -209,10 +209,10 @@ partial def getLiteral (v : Value) : CompilerM (Option ((Array CodeDecl) × FVar
return none
where
go : Value → CompilerM ((Array CodeDecl) × FVarId)
| .ctor `Nat.zero #[] .. => do
| .ctor ``Nat.zero #[] .. => do
let decl ← mkAuxLetDecl <| .lit <| .nat <| 0
return (#[.let decl], decl.fvarId)
| .ctor `Nat.succ #[val] .. => do
| .ctor ``Nat.succ #[val] .. => do
let val := getNatConstant val + 1
let decl ← mkAuxLetDecl <| .lit <| .nat <| val
return (#[.let decl], decl.fvarId)
@ -228,8 +228,8 @@ where
| _ => unreachable!
getNatConstant : Value → Nat
| .ctor `Nat.zero #[] .. => 0
| .ctor `Nat.succ #[val] .. => getNatConstant val + 1
| .ctor ``Nat.zero #[] .. => 0
| .ctor ``Nat.succ #[val] .. => getNatConstant val + 1
| _ => panic! "Not a well formed Nat constant Value"
end Value