Remove old util-kwargs, replace with Racket-compatible define*/lambda* forms.

This commit is contained in:
Dominik Pantůček 2023-05-25 14:43:01 +02:00
parent d24526b765
commit 963d3069e9
6 changed files with 399 additions and 52 deletions

View file

@ -39,7 +39,7 @@
(chicken format)
testing
ansi
util-kwargs
racket-kwargs
util-dict-list
table)
@ -127,21 +127,21 @@
;; Prints and highlights a selection of source listing lines and
;; their optional context.
(define-kwproc (print-source-listing
lines
highlights
(#:highlight-rules highlight-rules
`((error ,(ansi #:bold #:red) ,(ansi #:default))
(warning ,(ansi #:yellow) ,(ansi #:default))
(info ,(ansi #:cyan) ,(ansi #:default))
))
(#:ellipsis ellipsis "...")
(#:context-pre ctx-pre "")
(#:context-post ctx-post "")
(#:highlight-pre hl-pre a:error)
(#:highlight-post hl-post a:default)
(#:context context 3)
(#:keys keys '(number line comment)))
(define* (print-source-listing
lines
highlights
#:highlight-rules (highlight-rules
`((error ,(ansi #:bold #:red) ,(ansi #:default))
(warning ,(ansi #:yellow) ,(ansi #:default))
(info ,(ansi #:cyan) ,(ansi #:default))
))
#:ellipsis (ellipsis "...")
#:context-pre (ctx-pre "")
#:context-post (ctx-post "")
#:highlight-pre (hl-pre a:error)
#:highlight-post (hl-post a:default)
#:context (context 3)
#:keys (keys '(number line comment)))
(let loop ((lines lines)
(number 1)
(printed-something #f)