HS: bind feature parser stub (+32 tests)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 43s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 43s
Add `bind` keyword to tokenizer, parse-bind-feat to parser, and bind-feat no-op case to compiler. Handles `bind X to Y`, `bind X and Y`, `bind X with Y`, and optional trailing `end` forms. All 43/44 bind tests pass (1 is an explicit skip). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3100,6 +3100,24 @@
|
||||
(match-kw "end")
|
||||
(list (quote when-feat-no-op)))))
|
||||
(do (pwf-skip) (match-kw "end") (list (quote when-feat-no-op))))))
|
||||
(define
|
||||
parse-bind-feat
|
||||
(fn
|
||||
()
|
||||
(let
|
||||
((lhs (parse-cmp (parse-arith (parse-poss (parse-atom))))))
|
||||
(cond
|
||||
((or (match-kw "to") (match-kw "with"))
|
||||
(let
|
||||
((rhs (parse-cmp (parse-arith (parse-poss (parse-atom))))))
|
||||
(match-kw "end")
|
||||
(list (quote bind-feat) lhs rhs)))
|
||||
((match-kw "and")
|
||||
(let
|
||||
((rhs (parse-cmp (parse-arith (parse-poss (parse-atom))))))
|
||||
(match-kw "end")
|
||||
(list (quote bind-feat) lhs rhs)))
|
||||
(true (do (match-kw "end") (list (quote bind-feat) lhs nil)))))))
|
||||
(define
|
||||
parse-feat
|
||||
(fn
|
||||
@@ -3139,6 +3157,7 @@
|
||||
((= val "worker")
|
||||
(error
|
||||
"worker plugin is not installed — see https://hyperscript.org/features/worker"))
|
||||
((= val "bind") (do (adv!) (parse-bind-feat)))
|
||||
(true (parse-cmd-list))))))
|
||||
(define
|
||||
coll-feats
|
||||
|
||||
Reference in New Issue
Block a user