Compare commits

...

1 Commits

Author SHA1 Message Date
Kyle Miller
37ce6a5b07 feat: make loose fvars pretty print as _fvar.123 instead of _uniq.123
Loose fvars are never supposed to be pretty printed, but having them print with "fvar" in the name can help with debugging broken tactics and elaborators.
2024-02-17 09:55:15 -08:00
2 changed files with 8 additions and 8 deletions

View File

@@ -24,13 +24,13 @@ def unfoldMDatas : Expr → Expr
@[builtin_delab fvar]
def delabFVar : Delab := do
let Expr.fvar fvarId getExpr | unreachable!
try
let l fvarId.getDecl
maybeAddBlockImplicit (mkIdent l.userName)
catch _ =>
-- loose free variable, use internal name
maybeAddBlockImplicit <| mkIdent fvarId.name
let Expr.fvar fvarId getExpr | unreachable!
try
let l fvarId.getDecl
maybeAddBlockImplicit (mkIdent l.userName)
catch _ =>
-- loose free variable, use internal name
maybeAddBlockImplicit <| mkIdent (fvarId.name.replacePrefix `_uniq `_fvar)
-- loose bound variable, use pseudo syntax
@[builtin_delab bvar]

View File

@@ -1,7 +1,7 @@
let y := Nat.zero;
Nat.add y y
fun y_1 => Nat.add y y_1
fun y => Nat.add _uniq.1 y
fun y => Nat.add _fvar.1 y
fun (y : Nat) => Nat.add y y
Nat.add ?m y
Nat.add (?m #0) #0