From d865c4d58dc18018bfd1920bfa97b658710b53e8 Mon Sep 17 00:00:00 2001 From: giles Date: Fri, 24 Apr 2026 14:08:29 +0000 Subject: [PATCH] =?UTF-8?q?HS:=20plan/scoreboard=20=E2=80=94=20fill=20in?= =?UTF-8?q?=20SHA=206c1da921=20for=20cluster=2028?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plans/hs-conformance-scoreboard.md | 2 +- plans/hs-conformance-to-100.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plans/hs-conformance-scoreboard.md b/plans/hs-conformance-scoreboard.md index 606ee35a..c4535e64 100644 --- a/plans/hs-conformance-scoreboard.md +++ b/plans/hs-conformance-scoreboard.md @@ -53,7 +53,7 @@ Remaining: ~232 tests |---|---------|--------|---|--------| | 26 | resize observer mock + `on resize` | done | +3 | 304a52d2 | | 27 | intersection observer mock + `on intersection` | done | +3 | 0c31dd27 | -| 28 | `ask`/`answer` + prompt/confirm mock | done | +4 | SHA-PENDING | +| 28 | `ask`/`answer` + prompt/confirm mock | done | +4 | 6c1da921 | | 29 | `hyperscript:before:init` / `:after:init` / `:parse-error` | pending | (+4–6 est) | — | | 30 | `logAll` config | done | +1 | 64bcefff | diff --git a/plans/hs-conformance-to-100.md b/plans/hs-conformance-to-100.md index 79cbc6b1..fc0803f1 100644 --- a/plans/hs-conformance-to-100.md +++ b/plans/hs-conformance-to-100.md @@ -178,7 +178,7 @@ Many tests are `SKIP (untranslated)` because `tests/playwright/generate-sx-tests (Reverse chronological — newest at top.) ### 2026-04-24 — cluster 28 ask/answer + prompt/confirm mock -- **SHA-PENDING** — `HS: ask/answer + prompt/confirm mock (+4 tests)`. Five-part change: (a) `tokenizer.sx` registers `ask` and `answer` as hs-keywords. (b) `parser.sx` — `cmd-kw?` gains both, `parse-cmd` gains cond branches dispatching to new `parse-ask-cmd` (emits `(ask MSG)`) and `parse-answer-cmd` which reads `answer MSG [with YES or NO]` with `parse-atom` for the choices (using `parse-expr` there collapsed `"Yes" or "No"` into `(or "Yes" "No")` before `match-kw "or"` could fire — parse-atom skips the logical layer). No-`with` form emits `(answer-alert MSG)`. (c) `compiler.sx` — three new cond branches (`ask`, `answer`, `answer-alert`) compile to `(let ((__hs-a (hs-XXX ...))) (begin (set! the-result __hs-a) (set! it __hs-a) __hs-a))` so `then put it into …` works. (d) `runtime.sx` — `hs-ask`, `hs-answer`, `hs-answer-alert` call `window.prompt`/`confirm`/`alert` via `host-call (host-global "window") …`. (e) `tests/hs-run-filtered.js` — test-name-keyed stubs for `globalThis.{alert,confirm,prompt}`, `__currentHsTestName` updated before each test. One extra tweak: `host-set!` innerHTML/textContent now coerces JS `null` → the string `"null"` (matching browser behaviour) so `prompt` returning null → `put it into #out` renders literal `"null"` text — the fourth test depends on exactly this. Suite hs-upstream-askAnswer: 1/5 → 5/5. Smoke 0-195: 166/195 → 170/195. +- **6c1da921** — `HS: ask/answer + prompt/confirm mock (+4 tests)`. Five-part change: (a) `tokenizer.sx` registers `ask` and `answer` as hs-keywords. (b) `parser.sx` — `cmd-kw?` gains both, `parse-cmd` gains cond branches dispatching to new `parse-ask-cmd` (emits `(ask MSG)`) and `parse-answer-cmd` which reads `answer MSG [with YES or NO]` with `parse-atom` for the choices (using `parse-expr` there collapsed `"Yes" or "No"` into `(or "Yes" "No")` before `match-kw "or"` could fire — parse-atom skips the logical layer). No-`with` form emits `(answer-alert MSG)`. (c) `compiler.sx` — three new cond branches (`ask`, `answer`, `answer-alert`) compile to `(let ((__hs-a (hs-XXX ...))) (begin (set! the-result __hs-a) (set! it __hs-a) __hs-a))` so `then put it into …` works. (d) `runtime.sx` — `hs-ask`, `hs-answer`, `hs-answer-alert` call `window.prompt`/`confirm`/`alert` via `host-call (host-global "window") …`. (e) `tests/hs-run-filtered.js` — test-name-keyed stubs for `globalThis.{alert,confirm,prompt}`, `__currentHsTestName` updated before each test. One extra tweak: `host-set!` innerHTML/textContent now coerces JS `null` → the string `"null"` (matching browser behaviour) so `prompt` returning null → `put it into #out` renders literal `"null"` text — the fourth test depends on exactly this. Suite hs-upstream-askAnswer: 1/5 → 5/5. Smoke 0-195: 166/195 → 170/195. ### 2026-04-24 — cluster 25 parenthesized commands and features - **d7a88d85** — `HS: parenthesized commands and features (+1 test)`. Parser-only fix in `lib/hyperscript/parser.sx`. Three additions: (a) `parse-feat` gets a new cond branch — on `paren-open`, advance, recurse `parse-feat`, consume `paren-close`; lets features like `(on click ...)` be grouped. (b) `parse-cmd` gets two new cond branches — on `paren-close` return nil (so `cl-collect` terminates when the outer paren group ends), and on `paren-open` advance+recurse+close (parenthesized single commands like `(log me)`). (c) The key missing piece: `cl-collect` previously only recursed when the next token was a recognised command keyword (`cmd-kw?`), so after the first `(log me)` the next `(trigger foo)` would end the body. Extended the recursion predicate to also fire when the next token is `paren-open`. Result: `on click (log me) (trigger foo)` now emits both commands inside the handler body, not the second as a sibling top-level feature. Suite hs-upstream-core/parser: 9/14 → 10/14. Smoke 0-195: 165/195 → 166/195.