feat: allow line-wrapping when printing DiscrTree.Keys (#7200)

This PR allows the debug form of DiscrTree.Key to line-wrap.
This commit is contained in:
Eric Wieser 2025-02-24 07:52:47 +00:00 committed by GitHub
parent e7dc0d31f4
commit 57c8ab269b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -96,13 +96,14 @@ where
if args.isEmpty then
return f
else
let mut r := f
let mut r := m!""
for arg in args do
r := r ++ m!" {arg}"
r := r ++ Format.line ++ arg
r := f ++ .nest 2 r
if parenIfNonAtomic then
return m!"({r})"
return .paren r
else
return r
return .group r
go (parenIfNonAtomic := true) : StateRefT (List Key) CoreM MessageData := do
let some key ← next? | return .nil