handler-source: fix keywords, add syntax highlighting

Keywords were printed as strings because list treated :path as kwargs.
Now uses make-keyword to build keyword nodes. Output goes through
highlight for syntax coloring.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-01 14:27:20 +00:00
parent 678d96e1ea
commit 32001d03eb

View File

@@ -38,17 +38,26 @@
(csrf (get hdef "csrf"))
(returns (or (get hdef "returns") "element"))
(params (or (get hdef "params") (list)))
(body (get hdef "body")))
(pretty-print
(list
(make-symbol "defhandler")
(make-symbol name)
:path path
:method (make-keyword method)
:csrf csrf
:returns returns
params
body)))))))
(body (get hdef "body"))
(parts (list (make-symbol "defhandler") (make-symbol name))))
(let
((parts (append parts (list (make-keyword "path") path)))
(parts
(append
parts
(list (make-keyword "method") (make-keyword method))))
(parts
(if
(not csrf)
(append parts (list (make-keyword "csrf") false))
parts))
(parts
(if
(not (= returns "element"))
(append parts (list (make-keyword "returns") returns))
parts))
(parts (append parts (list params body))))
(highlight (pretty-print parts))))))))
(define _spec-dirs (list "spec" "web" "shared/sx/ref" "lib"))