Files
rose-ash/sx/sx/specs-explorer/spec-explorer-stats.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

40 lines
1.3 KiB
Plaintext

(defcomp
(&key stats)
(let-match
{:lines lines :io-count io-count :render-count render-count :pure-count pure-count :mutation-count mutation-count :test-total test-total :total-defines total-defines}
stats
(div
(~tw :tokens "flex flex-wrap gap-2 mb-6 text-xs")
(span
(~tw
:tokens "bg-stone-100 text-stone-600 px-2 py-0.5 rounded font-medium")
(str total-defines " defines"))
(when
(> pure-count 0)
(span
(~tw :tokens "bg-green-100 text-green-700 px-2 py-0.5 rounded")
(str pure-count " pure")))
(when
(> mutation-count 0)
(span
(~tw :tokens "bg-amber-100 text-amber-700 px-2 py-0.5 rounded")
(str mutation-count " mutation")))
(when
(> io-count 0)
(span
(~tw :tokens "bg-orange-100 text-orange-700 px-2 py-0.5 rounded")
(str io-count " io")))
(when
(> render-count 0)
(span
(~tw :tokens "bg-sky-100 text-sky-700 px-2 py-0.5 rounded")
(str render-count " render")))
(when
(> test-total 0)
(span
(~tw :tokens "bg-violet-100 text-violet-700 px-2 py-0.5 rounded")
(str test-total " tests")))
(span
(~tw :tokens "bg-stone-100 text-stone-500 px-2 py-0.5 rounded")
(str lines " lines")))))