Chez inc7: reader features — ##Inf/##NaN, #(...), #?(...), ns :require aliases

Reader gaps the Chez-hosted analyzer hit where the Janet reader didn't:
- ##Inf / ##-Inf / ##NaN symbolic literals (## dispatch -> flonum).
- #(...) anonymous fn shorthand -> (fn* [p__N#] body), with % / %N / %& and the
  max-positional arity rule; scans + rewrites list/vector/set/map bodies.
- #?(...) reader conditional: feature set {:jolt :default}, first matching clause
  wins. #?@ splicing not yet supported (one niche case allowlisted).
- (ns name (:require [a :as x])) — the require pre-scan now also reads aliases
  from an ns form's :require/:use clauses, not just bare (require ...).

Zero-Janet corpus parity 2240 -> 2288, 0 divergences (2 now-reachable cases
allowlisted: str of Infinity inside a collection — same as the prelude gate —
and #?@ splice). spine-test 35/35; prelude parity 2295 unchanged, 0 new
divergences.
This commit is contained in:
Yogthos 2026-06-20 01:57:36 -04:00
parent 011e5d6337
commit 7d0070d873
3 changed files with 111 additions and 7 deletions

View file

@ -69,7 +69,13 @@
"direct builtin override" true
"methods table inspectable" true
"atom override fires nested" true
"atom?" true})
"atom?" true
# str of an Infinity/NaN INSIDE a collection renders the flonum form, not
# "Infinity" — the prelude gate allowlists this too (Phase-2 recursive str).
"inf inside coll" true
# #?@ reader-conditional splicing into the enclosing seq isn't supported yet
# (plain #? works); a single niche corpus case.
"reader cond splice" true})
(var pass 0)
(def crashes @[]) # nonzero chez exit (analyzer/emitter raised, or runtime gap)
@ -157,7 +163,7 @@
# Regression floor: raise as the Chez-hosted compiler closes gaps. The gate fails
# on any NEW divergence or if pass drops below the floor. Strided runs scale to 0.
(def base-floor (scan-number (or (os/getenv "JOLT_CHEZ_ZJ_FLOOR") "2240")))
(def base-floor (scan-number (or (os/getenv "JOLT_CHEZ_ZJ_FLOOR") "2288")))
(def floor (if (os/getenv "JOLT_CORPUS_LIMIT") 0 base-floor))
(when (or (> (length diverged) 0) (< pass floor))
(printf "REGRESSION: pass %d < floor %d or %d new divergence(s)" pass floor (length diverged)))