Chez parity: STM stub + portable line-seq (janet.* audit, jolt-0obq)
Audit of the janet.*/jolt.interop/STM corpus cases vs Chez equivalents: the Janet FFI-bridge cases (janet/string, janet/type, janet.math/sqrt, janet.string/ascii- upper) test functionality already covered by PORTABLE corpus cases (str 29, type 9, sqrt 3, upper-case 9), so they're safe to delete in Phase 5. Two needed a Chez equivalent so they pass instead of being lost: - clojure.lang.LockingTransaction/isRunning -> false (no STM on jolt). - line-seq: the corpus case used janet/spit setup but was the SOLE line-seq coverage (0 other cases). Ported janet/spit->spit, and added a native Chez line-seq (drain a jhost io/reader + split on newline; no trailing empty line) that delegates a Janet map-reader to the overlay version. zero-Janet 2694->2696, prelude floor 2648; self-host + Janet gate + JVM cert green. jolt-cf1q.7 jolt-0obq
This commit is contained in:
parent
52a1ab5970
commit
32d2028559
5 changed files with 27 additions and 2 deletions
|
|
@ -128,6 +128,20 @@
|
|||
(jolt-invoke (var-deref "clojure.core" "read-string")
|
||||
(if (reader-jhost? reader) (drain-reader reader) (jolt-str-render-one reader))))
|
||||
|
||||
;; line-seq (jolt-0obq): the overlay line-seq reads via a Janet map-reader's
|
||||
;; :read-line-fn, but a Chez io/reader is a jhost StringReader. Drain it (or take a
|
||||
;; string) and split on newline; a trailing newline does NOT yield a final empty
|
||||
;; line (like readLine -> nil at EOF). Re-asserted in post-prelude.ss.
|
||||
(define (chez-lines s)
|
||||
(let loop ((cs (string->list s)) (cur '()) (acc '()))
|
||||
(cond ((null? cs) (reverse (if (null? cur) acc (cons (list->string (reverse cur)) acc))))
|
||||
((char=? (car cs) #\newline) (loop (cdr cs) '() (cons (list->string (reverse cur)) acc)))
|
||||
(else (loop (cdr cs) (cons (car cs) cur) acc)))))
|
||||
(define (chez-line-seq rdr)
|
||||
(list->cseq (chez-lines (cond ((string? rdr) rdr)
|
||||
((reader-jhost? rdr) (drain-reader rdr))
|
||||
(else (jolt-str-render-one rdr))))))
|
||||
|
||||
(define (jolt-slurp src . opts)
|
||||
(cond
|
||||
((jfile? src) (read-file-string (jfile-path src)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue