Step 7d complete: exhaustive match checking + evaluator cleanup
Match exhaustiveness analysis: - check-match-exhaustiveness function in evaluator.sx - lint-node in tree-tools.sx checks match forms during format-check - Warns on: no wildcard/catch-all, boolean missing true/false case - (match x (true "yes")) → "match may be non-exhaustive" Evaluator cleanup: - Added missing step-sf-callcc definition (was in old transpiled output) - Added missing step-sf-case definition (was in old transpiled output) - Removed protocol functions from bootstrap skip set (they transpile fine) - Retranspiled VM (bootstrap_vm.py) for compatibility 2650 tests pass (+5 from new features). All Step 7 features complete: 7a: ->> |> as-> pipe operators 7b: Dict patterns, &rest, let-match destructuring 7c: define-protocol, implement, satisfies? 7d: Exhaustive match checking Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1059,6 +1059,31 @@
|
||||
pname)))
|
||||
(append! seen pname)))))
|
||||
params))))))
|
||||
(when
|
||||
(= head-name "match")
|
||||
(when
|
||||
(>= (len node) 3)
|
||||
(let
|
||||
((clauses (rest (rest node)))
|
||||
(patterns (map first clauses))
|
||||
(has-wildcard
|
||||
(some
|
||||
(fn
|
||||
(p)
|
||||
(and
|
||||
(symbol? p)
|
||||
(not (= (symbol-name p) "true"))
|
||||
(not (= (symbol-name p) "false"))))
|
||||
patterns))
|
||||
(has-else false))
|
||||
(when
|
||||
(not has-wildcard)
|
||||
(append!
|
||||
warnings
|
||||
(str
|
||||
"WARN "
|
||||
(path-str path)
|
||||
": match may be non-exhaustive (no catch-all pattern)"))))))
|
||||
(for-each
|
||||
(fn
|
||||
(i)
|
||||
|
||||
Reference in New Issue
Block a user