Skip to content

Commit

Permalink
doc: explain app_delab
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-wieser authored Dec 26, 2024
1 parent 0ebe9e5 commit 6071281
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Lean/PrettyPrinter/Delaborator/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ unsafe def mkDelabAttribute : IO (KeyedDeclsAttribute Delab) :=
} `Lean.PrettyPrinter.Delaborator.delabAttribute
@[builtin_init mkDelabAttribute] opaque delabAttribute : KeyedDeclsAttribute Delab

/-- `@[app_delab c]` registers a declaration of type `Lean.PrettyPrinter.Delaborator.Delab` for applications
of the constant `c` (including "nullary applications").
It should be preferred over the otherwise-equivalent `@[delab app.c]`, as it first performs name-resolution
on `c`. -/
macro "app_delab" id:ident : attr => do
match ← Macro.resolveGlobalName id.getId with
| [] => Macro.throwErrorAt id s!"unknown declaration '{id.getId}'"
Expand Down

0 comments on commit 6071281

Please sign in to comment.