Compare commits
3 Commits
db8d7aca91
...
hs-e39-web
| Author | SHA1 | Date | |
|---|---|---|---|
| 573f9fa4b3 | |||
| 912649c426 | |||
| 67a5f13713 |
@@ -1059,9 +1059,16 @@
|
||||
(quote hs-method-call)
|
||||
(cons obj (cons method args))))
|
||||
(if
|
||||
(and (list? dot-node) (= (first dot-node) (quote ref)))
|
||||
(list (quote hs-win-call) (nth dot-node 1) (cons (quote list) args))
|
||||
(cons (quote hs-method-call) (cons (hs-to-sx dot-node) args))))))
|
||||
(and
|
||||
(list? dot-node)
|
||||
(= (first dot-node) (quote ref)))
|
||||
(list
|
||||
(quote hs-win-call)
|
||||
(nth dot-node 1)
|
||||
(cons (quote list) args))
|
||||
(cons
|
||||
(quote hs-method-call)
|
||||
(cons (hs-to-sx dot-node) args))))))
|
||||
((= head (quote string-postfix))
|
||||
(list (quote str) (hs-to-sx (nth ast 1)) (nth ast 2)))
|
||||
((= head (quote block-literal))
|
||||
@@ -1231,7 +1238,12 @@
|
||||
(list (quote hs-coerce) (hs-to-sx (nth ast 1)) (nth ast 2)))
|
||||
((= head (quote in?))
|
||||
(list
|
||||
(quote hs-contains?)
|
||||
(quote hs-in?)
|
||||
(hs-to-sx (nth ast 2))
|
||||
(hs-to-sx (nth ast 1))))
|
||||
((= head (quote in-bool?))
|
||||
(list
|
||||
(quote hs-in-bool?)
|
||||
(hs-to-sx (nth ast 2))
|
||||
(hs-to-sx (nth ast 1))))
|
||||
((= head (quote of))
|
||||
@@ -1717,7 +1729,16 @@
|
||||
(rest (reverse compiled)))
|
||||
(let
|
||||
((defs (filter (fn (c) (and (list? c) (> (len c) 0) (= (first c) (quote define)))) compiled))
|
||||
(non-defs (filter (fn (c) (not (and (list? c) (> (len c) 0) (= (first c) (quote define))))) compiled)))
|
||||
(non-defs
|
||||
(filter
|
||||
(fn
|
||||
(c)
|
||||
(not
|
||||
(and
|
||||
(list? c)
|
||||
(> (len c) 0)
|
||||
(= (first c) (quote define)))))
|
||||
compiled)))
|
||||
(cons (quote do) (append defs non-defs)))))))
|
||||
((= head (quote wait)) (list (quote hs-wait) (nth ast 1)))
|
||||
((= head (quote wait-for)) (emit-wait-for ast))
|
||||
@@ -1826,8 +1847,12 @@
|
||||
(make-symbol raw-fn)
|
||||
(hs-to-sx raw-fn)))
|
||||
(args (map hs-to-sx (rest (rest ast)))))
|
||||
(if (and (list? raw-fn) (= (first raw-fn) (quote ref)))
|
||||
(list (quote hs-win-call) (nth raw-fn 1) (cons (quote list) args))
|
||||
(if
|
||||
(and (list? raw-fn) (= (first raw-fn) (quote ref)))
|
||||
(list
|
||||
(quote hs-win-call)
|
||||
(nth raw-fn 1)
|
||||
(cons (quote list) args))
|
||||
(cons fn-expr args))))
|
||||
((= head (quote return))
|
||||
(let
|
||||
@@ -2098,7 +2123,7 @@
|
||||
(hs-to-sx (nth ast 1)))))
|
||||
((= head (quote in?))
|
||||
(list
|
||||
(quote hs-contains?)
|
||||
(quote hs-in?)
|
||||
(hs-to-sx (nth ast 2))
|
||||
(hs-to-sx (nth ast 1))))
|
||||
((= head (quote type-check))
|
||||
|
||||
@@ -495,7 +495,8 @@
|
||||
(quote and)
|
||||
(list (quote >=) left lo)
|
||||
(list (quote <=) left hi)))))
|
||||
((match-kw "in") (list (quote in?) left (parse-expr)))
|
||||
((match-kw "in")
|
||||
(list (quote in-bool?) left (parse-expr)))
|
||||
((match-kw "really")
|
||||
(do
|
||||
(match-kw "equal")
|
||||
@@ -571,7 +572,8 @@
|
||||
(let
|
||||
((right (parse-expr)))
|
||||
(list (quote not) (list (quote =) left right))))))
|
||||
((match-kw "in") (list (quote in?) left (parse-expr)))
|
||||
((match-kw "in")
|
||||
(list (quote in-bool?) left (parse-expr)))
|
||||
((match-kw "empty") (list (quote empty?) left))
|
||||
((match-kw "between")
|
||||
(let
|
||||
@@ -2747,6 +2749,7 @@
|
||||
((= val "behavior") (do (adv!) (parse-behavior-feat)))
|
||||
((= val "live") (do (adv!) (parse-live-feat)))
|
||||
((= val "when") (do (adv!) (parse-when-feat)))
|
||||
((= val "worker") (error "worker plugin is not installed — see https://hyperscript.org/features/worker"))
|
||||
(true (parse-cmd-list))))))
|
||||
(define
|
||||
coll-feats
|
||||
|
||||
@@ -1535,6 +1535,25 @@
|
||||
(hs-contains? (rest collection) item))))))
|
||||
(true false))))
|
||||
|
||||
(define
|
||||
hs-in?
|
||||
(fn
|
||||
(collection item)
|
||||
(cond
|
||||
((nil? collection) (list))
|
||||
((list? collection)
|
||||
(cond
|
||||
((nil? item) (list))
|
||||
((list? item)
|
||||
(filter (fn (x) (hs-contains? collection x)) item))
|
||||
((hs-contains? collection item) (list item))
|
||||
(true (list))))
|
||||
(true (list)))))
|
||||
|
||||
(define
|
||||
hs-in-bool?
|
||||
(fn (collection item) (not (hs-falsy? (hs-in? collection item)))))
|
||||
|
||||
(define
|
||||
hs-is
|
||||
(fn
|
||||
|
||||
@@ -4,7 +4,7 @@ Live tally for `plans/hs-conformance-to-100.md`. Update after every cluster comm
|
||||
|
||||
```
|
||||
Baseline: 1213/1496 (81.1%)
|
||||
Merged: 1302/1496 (87.0%) delta +89
|
||||
Merged: 1303/1496 (87.1%) delta +90
|
||||
Worktree: all landed
|
||||
Target: 1496/1496 (100.0%)
|
||||
Remaining: ~194 tests (clusters 17/29(partial)/31 blocked; 33/34 partial)
|
||||
|
||||
@@ -177,6 +177,9 @@ Many tests are `SKIP (untranslated)` because `tests/playwright/generate-sx-tests
|
||||
|
||||
(Reverse chronological — newest at top.)
|
||||
|
||||
### 2026-04-25 — Bucket F: in-expression filter semantics (+1)
|
||||
- **67a5f137** — `HS: in-expression filter semantics (+1 test)`. `1 in [1, 2, 3]` was returning boolean `true` instead of the filtered list `(list 1)`. Root cause: `in?` compiled to `hs-contains?` which returns boolean for scalar items. Fix: (a) `runtime.sx` adds `hs-in?` returning filtered list for all cases, plus `hs-in-bool?` which wraps with `(not (hs-falsy? ...))` for boolean contexts; (b) `compiler.sx` changes `in?` clause to emit `(hs-in? collection item)` and adds new `in-bool?` clause emitting `(hs-in-bool? collection item)`; (c) `parser.sx` changes `is in` and `am in` comparison forms to produce `in-bool?` so those stay boolean. Suite hs-upstream-expressions/in: 8/9 → 9/9. Smoke 0-195: 173/195 unchanged.
|
||||
|
||||
### 2026-04-25 — cluster 22 window global fn fallback (+1)
|
||||
- **d31565d5** — `HS cluster 22: simplify win-call emit + def→window + init-blocks test (+1)`. Two-part change building on 337c8265 (host-call-fn FFI + hs-win-call runtime). (a) `compiler.sx` removes the guard wrapper from bare-call and method-call `hs-win-call` emit paths — direct `(hs-win-call name (list args))` is sufficient since hs-win-call returns nil for unknown names; `def` compilation now also emits `(host-set! (host-global "window") name fn)` so every HS-defined function is reachable via window lookup. (b) `generate-sx-tests.py` fixes a quoting bug: `\"here\"` was being embedded as three SX nodes (`""` + symbol + `""`) instead of a single escaped-quote string; fixed with `\\\"` escaping. Hand-rolled deftest for `can refer to function in init blocks` now passes. Suite hs-upstream-core/regressions: 13/16 → 14/16. Smoke 0-195: 172/195 → 173/195.
|
||||
|
||||
|
||||
@@ -1059,9 +1059,16 @@
|
||||
(quote hs-method-call)
|
||||
(cons obj (cons method args))))
|
||||
(if
|
||||
(and (list? dot-node) (= (first dot-node) (quote ref)))
|
||||
(list (quote hs-win-call) (nth dot-node 1) (cons (quote list) args))
|
||||
(cons (quote hs-method-call) (cons (hs-to-sx dot-node) args))))))
|
||||
(and
|
||||
(list? dot-node)
|
||||
(= (first dot-node) (quote ref)))
|
||||
(list
|
||||
(quote hs-win-call)
|
||||
(nth dot-node 1)
|
||||
(cons (quote list) args))
|
||||
(cons
|
||||
(quote hs-method-call)
|
||||
(cons (hs-to-sx dot-node) args))))))
|
||||
((= head (quote string-postfix))
|
||||
(list (quote str) (hs-to-sx (nth ast 1)) (nth ast 2)))
|
||||
((= head (quote block-literal))
|
||||
@@ -1231,7 +1238,12 @@
|
||||
(list (quote hs-coerce) (hs-to-sx (nth ast 1)) (nth ast 2)))
|
||||
((= head (quote in?))
|
||||
(list
|
||||
(quote hs-contains?)
|
||||
(quote hs-in?)
|
||||
(hs-to-sx (nth ast 2))
|
||||
(hs-to-sx (nth ast 1))))
|
||||
((= head (quote in-bool?))
|
||||
(list
|
||||
(quote hs-in-bool?)
|
||||
(hs-to-sx (nth ast 2))
|
||||
(hs-to-sx (nth ast 1))))
|
||||
((= head (quote of))
|
||||
@@ -1717,7 +1729,16 @@
|
||||
(rest (reverse compiled)))
|
||||
(let
|
||||
((defs (filter (fn (c) (and (list? c) (> (len c) 0) (= (first c) (quote define)))) compiled))
|
||||
(non-defs (filter (fn (c) (not (and (list? c) (> (len c) 0) (= (first c) (quote define))))) compiled)))
|
||||
(non-defs
|
||||
(filter
|
||||
(fn
|
||||
(c)
|
||||
(not
|
||||
(and
|
||||
(list? c)
|
||||
(> (len c) 0)
|
||||
(= (first c) (quote define)))))
|
||||
compiled)))
|
||||
(cons (quote do) (append defs non-defs)))))))
|
||||
((= head (quote wait)) (list (quote hs-wait) (nth ast 1)))
|
||||
((= head (quote wait-for)) (emit-wait-for ast))
|
||||
@@ -1826,8 +1847,12 @@
|
||||
(make-symbol raw-fn)
|
||||
(hs-to-sx raw-fn)))
|
||||
(args (map hs-to-sx (rest (rest ast)))))
|
||||
(if (and (list? raw-fn) (= (first raw-fn) (quote ref)))
|
||||
(list (quote hs-win-call) (nth raw-fn 1) (cons (quote list) args))
|
||||
(if
|
||||
(and (list? raw-fn) (= (first raw-fn) (quote ref)))
|
||||
(list
|
||||
(quote hs-win-call)
|
||||
(nth raw-fn 1)
|
||||
(cons (quote list) args))
|
||||
(cons fn-expr args))))
|
||||
((= head (quote return))
|
||||
(let
|
||||
@@ -2098,7 +2123,7 @@
|
||||
(hs-to-sx (nth ast 1)))))
|
||||
((= head (quote in?))
|
||||
(list
|
||||
(quote hs-contains?)
|
||||
(quote hs-in?)
|
||||
(hs-to-sx (nth ast 2))
|
||||
(hs-to-sx (nth ast 1))))
|
||||
((= head (quote type-check))
|
||||
|
||||
@@ -495,7 +495,8 @@
|
||||
(quote and)
|
||||
(list (quote >=) left lo)
|
||||
(list (quote <=) left hi)))))
|
||||
((match-kw "in") (list (quote in?) left (parse-expr)))
|
||||
((match-kw "in")
|
||||
(list (quote in-bool?) left (parse-expr)))
|
||||
((match-kw "really")
|
||||
(do
|
||||
(match-kw "equal")
|
||||
@@ -571,7 +572,8 @@
|
||||
(let
|
||||
((right (parse-expr)))
|
||||
(list (quote not) (list (quote =) left right))))))
|
||||
((match-kw "in") (list (quote in?) left (parse-expr)))
|
||||
((match-kw "in")
|
||||
(list (quote in-bool?) left (parse-expr)))
|
||||
((match-kw "empty") (list (quote empty?) left))
|
||||
((match-kw "between")
|
||||
(let
|
||||
@@ -2747,6 +2749,7 @@
|
||||
((= val "behavior") (do (adv!) (parse-behavior-feat)))
|
||||
((= val "live") (do (adv!) (parse-live-feat)))
|
||||
((= val "when") (do (adv!) (parse-when-feat)))
|
||||
((= val "worker") (error "worker plugin is not installed — see https://hyperscript.org/features/worker"))
|
||||
(true (parse-cmd-list))))))
|
||||
(define
|
||||
coll-feats
|
||||
|
||||
@@ -1535,6 +1535,25 @@
|
||||
(hs-contains? (rest collection) item))))))
|
||||
(true false))))
|
||||
|
||||
(define
|
||||
hs-in?
|
||||
(fn
|
||||
(collection item)
|
||||
(cond
|
||||
((nil? collection) (list))
|
||||
((list? collection)
|
||||
(cond
|
||||
((nil? item) (list))
|
||||
((list? item)
|
||||
(filter (fn (x) (hs-contains? collection x)) item))
|
||||
((hs-contains? collection item) (list item))
|
||||
(true (list))))
|
||||
(true (list)))))
|
||||
|
||||
(define
|
||||
hs-in-bool?
|
||||
(fn (collection item) (not (hs-falsy? (hs-in? collection item)))))
|
||||
|
||||
(define
|
||||
hs-is
|
||||
(fn
|
||||
|
||||
@@ -13595,5 +13595,9 @@ end")
|
||||
;; ── worker (1 tests) ──
|
||||
(defsuite "hs-upstream-worker"
|
||||
(deftest "raises a helpful error when the worker plugin is not installed"
|
||||
(error "SKIP (untranslated): raises a helpful error when the worker plugin is not installed"))
|
||||
(let ((result (guard (e (true (if (string? e) e (str e))))
|
||||
(hs-compile "worker MyWorker def noop() end end")
|
||||
"")))
|
||||
(assert (contains? result "worker plugin"))
|
||||
(assert (contains? result "hyperscript.org/features/worker"))))
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user