Fix hyperscript conformance: 54/112 passing (was 31/81 baseline)
Runtime visibility fix: - eval-hs now injects runtime helpers (hs-add, hs-falsy?, hs-strict-eq, hs-type-check, hs-matches?, hs-contains?, hs-coerce) via outer let binding so the tree-walker evaluator can resolve them Parser fixes: - null/undefined: return (null-literal) AST node instead of bare nil (nil was indistinguishable from "no parse result" sentinel) - === / !== tokenized as single 3-char operators - mod operator: emit (modulo) instead of (%) — modulo is a real primitive Compiler fixes: - null-literal → nil - % → modulo - contains? → hs-contains? (avoids tree-walker primitive arity conflict) Runtime additions: - hs-contains?: wraps list membership + string containment Tokenizer: - Added keywords: a, an (removed — broke all tokenization), exist - Triple operators: === and !== now tokenized correctly Scorecard: 54/112 test groups passing, +23 from baseline. Unlocked: really-equals, english comparisons, is-in, null is empty, null exists, type checks, strict equality, mod. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -266,6 +266,7 @@
|
||||
(let
|
||||
((head (first ast)))
|
||||
(cond
|
||||
((= head (quote null-literal)) nil)
|
||||
((= head (quote me)) (quote me))
|
||||
((= head (quote it)) (quote it))
|
||||
((= head (quote event)) (quote event))
|
||||
@@ -328,7 +329,7 @@
|
||||
(hs-to-sx (nth ast 2))))
|
||||
((= head pct-sym)
|
||||
(list
|
||||
pct-sym
|
||||
(quote modulo)
|
||||
(hs-to-sx (nth ast 1))
|
||||
(hs-to-sx (nth ast 2))))
|
||||
((= head (quote empty?))
|
||||
@@ -342,16 +343,16 @@
|
||||
(quote hs-matches?)
|
||||
(hs-to-sx (nth ast 1))
|
||||
(hs-to-sx (nth ast 2))))
|
||||
((= head (quote contains?))
|
||||
((= head (quote hs-contains?))
|
||||
(list
|
||||
(quote contains?)
|
||||
(quote hs-contains?)
|
||||
(hs-to-sx (nth ast 1))
|
||||
(hs-to-sx (nth ast 2))))
|
||||
((= head (quote as))
|
||||
(list (quote hs-coerce) (hs-to-sx (nth ast 1)) (nth ast 2)))
|
||||
((= head (quote in?))
|
||||
(list
|
||||
(quote contains?)
|
||||
(quote hs-contains?)
|
||||
(hs-to-sx (nth ast 2))
|
||||
(hs-to-sx (nth ast 1))))
|
||||
((= head (quote of))
|
||||
@@ -575,12 +576,12 @@
|
||||
(list
|
||||
(quote not)
|
||||
(list
|
||||
(quote contains?)
|
||||
(quote hs-contains?)
|
||||
(hs-to-sx (nth ast 2))
|
||||
(hs-to-sx (nth ast 1)))))
|
||||
((= head (quote in?))
|
||||
(list
|
||||
(quote contains?)
|
||||
(quote hs-contains?)
|
||||
(hs-to-sx (nth ast 2))
|
||||
(hs-to-sx (nth ast 1))))
|
||||
((= head (quote type-check))
|
||||
|
||||
Reference in New Issue
Block a user