Files
rose-ash/sx/sx/streaming-demo/stream-colors.sx
giles 4f02f82f4e HS parser: fix number+comparison keyword collision, eval-hs uses hs-compile
Parser: skip unit suffix when next ident is a comparison keyword
(starts, ends, contains, matches, is, does, in, precedes, follows).
Fixes "123 starts with '12'" returning "123starts" instead of true.

eval-hs: use hs-compile directly instead of hs-to-sx-from-source with
"return " prefix, which was causing the parser to consume the comparison
as a string suffix.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 11:29:01 +00:00

60 lines
1.3 KiB
Plaintext

;; Streaming & Suspense demo — Phase 6
;;
;; This page uses :stream true to enable chunked transfer encoding.
;; The browser receives the HTML shell immediately with loading skeletons,
;; then content fills in as each IO resolves at staggered intervals.
;;
;; The :data expression is an async generator that yields three chunks
;; at 1s, 3s, and 5s. Each chunk resolves a different ~shared:pages/suspense slot.
;; Color map for stream chunk styling (all string keys for get compatibility)
(define stream-colors
(dict
"emerald"
(dict
"border"
"border-emerald-200"
"bg"
"bg-emerald-50"
"dot"
"bg-emerald-400"
"title"
"text-emerald-900"
"text"
"text-emerald-800"
"sub"
"text-emerald-700"
"code"
"bg-emerald-100")
"amber"
(dict
"border"
"border-amber-200"
"bg"
"bg-amber-50"
"dot"
"bg-amber-400"
"title"
"text-amber-900"
"text"
"text-amber-800"
"sub"
"text-amber-700"
"code"
"bg-amber-100")
"violet"
(dict
"border"
"border-violet-200"
"bg"
"bg-violet-50"
"dot"
"bg-violet-400"
"title"
"text-violet-900"
"text"
"text-violet-800"
"sub"
"text-violet-700"
"code"
"bg-violet-100")))