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>
36 lines
1.0 KiB
Plaintext
36 lines
1.0 KiB
Plaintext
(defcomp
|
|
(&key path &rest children)
|
|
:affinity :server
|
|
(let*
|
|
((nav-state (resolve-nav-path sx-nav-tree (or path "/")))
|
|
(trail (or (get nav-state "trail") (list)))
|
|
(trail-len (len trail))
|
|
(depth (+ trail-len 1)))
|
|
(<>
|
|
(div
|
|
:id "sx-nav"
|
|
(~tw :tokens "mb-6")
|
|
:sx-swap-oob "innerHTML"
|
|
(div
|
|
:id "logo-opacity"
|
|
:style (str
|
|
"opacity:"
|
|
(+ (* (/ 1 depth) 0.75) 0.25)
|
|
";"
|
|
"transition:opacity 0.3s;")
|
|
(~layouts/header :path (or path "/")))
|
|
(map-indexed
|
|
(fn
|
|
(i crumb)
|
|
(~layouts/nav-sibling-row
|
|
:node (get crumb "node")
|
|
:siblings (get crumb "siblings")
|
|
:is-leaf (= i (- trail-len 1))
|
|
:level (+ i 2)
|
|
:depth depth))
|
|
trail)
|
|
(when
|
|
(get nav-state "children")
|
|
(~layouts/nav-children :items (get nav-state "children"))))
|
|
(div :id "sx-content" (error-boundary children) (~tw/flush)))))
|