From b7ad5152d8ddb63e5073a5dfa4ab432f6ec44b68 Mon Sep 17 00:00:00 2001 From: giles Date: Wed, 6 May 2026 22:27:26 +0000 Subject: [PATCH] =?UTF-8?q?sx:=20step=204=20=E2=80=94=20parser=20spans=20s?= =?UTF-8?q?atisfied=20by=20step=203=20tokenizer=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verified all 4 hs-upstream-core/sourceInfo tests now pass without any parser changes. The parser already had `link-next-cmds` (sets `:next` on each command in a CommandList when hs-span-mode is true) and `:true-branch` extraction in `parse-cmd` for if statements; Step 3's `:end`/`:line` token fields were the only missing pieces. Probed via sx_eval against the parser: (hs-line-at "if true\n log 'it was true'\n log 'it was true'" (list :true-branch :next)) returns " log 'it was true'" — matches the expected upstream behaviour. Test runner output: PASS: hs-upstream-core/sourceInfo > debug PASS: hs-upstream-core/sourceInfo > get line works for statements PASS: hs-upstream-core/sourceInfo > get source works for expressions PASS: hs-upstream-core/sourceInfo > get source works for statements --- plans/sx-improvements.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plans/sx-improvements.md b/plans/sx-improvements.md index 3310ba89..a9ad9534 100644 --- a/plans/sx-improvements.md +++ b/plans/sx-improvements.md @@ -74,6 +74,10 @@ Mirror to `shared/static/wasm/sx/hs-parser.sx`. **Verify:** All 4 `hs-upstream-core/sourceInfo` tests pass. +**Outcome:** Subsumed by Step 3. Once tokens carried `:end` and `:line`, the existing +parser plumbing (`link-next-cmds` for `:next`, `:true-branch` extraction in `parse-cmd`) +worked end-to-end. All 4 `hs-upstream-core/sourceInfo` tests pass with no parser changes. + --- ## Phase 3 — Native ADTs (`define-type` / `match`) @@ -184,7 +188,7 @@ these when operands are known numbers/lists. | 1 — JIT combinator bug | [x] | 882a4b76 | | 2 — letrec+resume | [x] | e80e655b | | 3 — tokenizer :end/:line | [x] | 023bc2d8 | -| 4 — parser spans complete | [ ] | — | +| 4 — parser spans complete | [x] | subsumed by 023bc2d8 | | 5 — OCaml AdtValue + define-type + match | [ ] | — | | 6 — JS AdtValue + define-type + match | [ ] | — | | 7 — nested patterns | [ ] | — |