Add unicode border style.

This commit is contained in:
Dominik Pantůček 2023-03-22 17:07:07 +01:00
parent a26773f9da
commit 595b26ac50

View file

@ -28,6 +28,8 @@
(module
table
(
*table-border-style*
table->string
table-tests!
)
@ -39,6 +41,9 @@
ansi
testing)
;; Default table border style to use if not explicitly specified.
(define *table-border-style* (make-parameter 'ascii))
;; Returns a list of strings representing the rows in the original
;; string.
(define (string->rows str)
@ -156,10 +161,16 @@
;; Table border styles in visual form
(define table-borders-lookup-source
'((ascii "/~,\\"
"| ||"
">-+<"
"'~^`")))
'((ascii
"/~,\\"
"| ||"
">-+<"
"'~^`")
(unicode
"┌─┬┐"
"│ ││"
"├─┼┤"
"└─┴┘")))
;; Compiled table borders for rendering
(define table-borders-lookup