mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Fix pretty printing of record types
This commit is contained in:
parent
cfd7512b9a
commit
9447dc9b05
2 changed files with 8 additions and 2 deletions
|
@ -6,6 +6,10 @@ Features
|
|||
|
||||
- Enhanced `c-define` to emit type checks for parameters.
|
||||
|
||||
Bug Fixes
|
||||
|
||||
- Allow `pretty-print` to display contents of a record type.
|
||||
|
||||
## 0.25 - January 25, 2021
|
||||
|
||||
Features
|
||||
|
|
|
@ -83,7 +83,9 @@
|
|||
|
||||
(cond ((pair? obj) (wr-expr obj col))
|
||||
((null? obj) (wr-lst obj col))
|
||||
((vector? obj) (wr-lst (vector->list obj) (out "#" col)))
|
||||
((or (vector? obj)
|
||||
(record? obj))
|
||||
(wr-lst (vector->list obj) (out "#" col)))
|
||||
((bytevector? obj) (wr-lst
|
||||
(map char->integer (string->list (utf8->string obj)))
|
||||
(out "#u8" col)))
|
||||
|
@ -134,7 +136,7 @@
|
|||
(spaces (- to col) col))))
|
||||
|
||||
(define (pr obj col extra pp-pair)
|
||||
(if (or (pair? obj) (vector? obj)) ; may have to split on multiple lines
|
||||
(if (or (pair? obj) (vector? obj) (record? obj)) ; may have to split on multiple lines
|
||||
(let ((result '())
|
||||
(left (min (+ (- (- width col) extra) 1) max-expr-width)))
|
||||
(generic-write obj display? #f
|
||||
|
|
Loading…
Add table
Reference in a new issue