def
Lean.Syntax.formatStx
(stx : Lean.Syntax)
(maxDepth : optParam (Option Nat) none)
(showInfo : optParam Bool false)
:
Pretty print the given syntax stx
as a Format
.
Nodes deeper than maxDepth
are omitted.
Setting the showInfo
flag will also print the SourceInfo
for each node.
Equations
- stx.formatStx maxDepth showInfo = Lean.Syntax.formatStxAux maxDepth showInfo 0 stx
Instances For
Equations
- Lean.Syntax.instToFormat = { format := fun (stx : Lean.Syntax) => stx.formatStx }
Equations
- Lean.Syntax.instToString = { toString := toString ∘ Std.format }
Equations
- Lean.Syntax.instToFormatTSyntax = { format := fun (x : Lean.TSyntax k) => Std.format x.raw }
Equations
- Lean.Syntax.instToStringTSyntax = { toString := fun (x : Lean.TSyntax k) => toString x.raw }