Files
rose-ash/lib/hyperscript/parser.sx
giles 24dbc966e9 HS: skip element/global/local scope prefix in set — +3 core/scoping
`set element x to 10` was compiling to `(set! (string-postfix (ref "element") "x") 10)`
because parse-expr greedily consumed `element x` as a string-postfix expression.
Recognise the bare `element` / `global` / `local` ident at the start of the
set target and skip it so `tgt` parses as just `x`. The variable lives in
the closure scope of the handler — close enough for handler-local use; a
real per-element store would need extra work in the compiler.

core/scoping: 9/20 → 12/20 (+3): "element scoped variables work",
"element scoped variables span features", "global scoped variables work".

The `:x` / `$x` short-syntax variants still fail because their listeners
aren't registering in the test mock — separate issue.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 11:32:20 +00:00

101 KiB