mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 04:25:06 +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.
|
- 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
|
## 0.25 - January 25, 2021
|
||||||
|
|
||||||
Features
|
Features
|
||||||
|
|
|
@ -83,7 +83,9 @@
|
||||||
|
|
||||||
(cond ((pair? obj) (wr-expr obj col))
|
(cond ((pair? obj) (wr-expr obj col))
|
||||||
((null? obj) (wr-lst 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
|
((bytevector? obj) (wr-lst
|
||||||
(map char->integer (string->list (utf8->string obj)))
|
(map char->integer (string->list (utf8->string obj)))
|
||||||
(out "#u8" col)))
|
(out "#u8" col)))
|
||||||
|
@ -134,7 +136,7 @@
|
||||||
(spaces (- to col) col))))
|
(spaces (- to col) col))))
|
||||||
|
|
||||||
(define (pr obj col extra pp-pair)
|
(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 '())
|
(let ((result '())
|
||||||
(left (min (+ (- (- width col) extra) 1) max-expr-width)))
|
(left (min (+ (- (- width col) extra) 1) max-expr-width)))
|
||||||
(generic-write obj display? #f
|
(generic-write obj display? #f
|
||||||
|
|
Loading…
Add table
Reference in a new issue