HS: plan/scoreboard — fill in SHA 6c1da921 for cluster 28

This commit is contained in:
2026-04-24 14:08:29 +00:00
parent 6c1da9212a
commit d865c4d58d
2 changed files with 2 additions and 2 deletions

View File

@@ -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 | (+46 est) | — |
| 30 | `logAll` config | done | +1 | 64bcefff |

View File

@@ -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.