Host completeness for the ring stack (ring-app)

Gaps surfaced loading ring-core / hiccup / config / tools.logging on Chez:

- clojure.java.io/resource — resolve a named resource against the loader's
  source roots (no classpath), returning a slurp-able File.
- (Object.) constructor — a fresh distinct value (lock / unique sentinel).
- *out* / *err* as dynamic vars over a port-writer, so (binding [*out* *err*] …)
  and #'*out* compile and run (tools.logging, selmer).
- :refer :all now registers a refer-all relation, so an unqualified var from a
  (require '[ns :refer :all]) resolves at compile time — including #'var.
- java.lang.Character interop ((.toString \+) etc.).
- StringReader accepts a char[] ((StringReader. (char-array s))), not just a
  String.
- the \p{L} translation stops just below the UTF-16 surrogate gap (\x{D7FF})
  instead of \x{10FFFF} — a range across the surrogates made irregex's char-set
  construction call integer->char on a surrogate and crash.
This commit is contained in:
Yogthos 2026-06-22 03:20:31 -04:00
parent 5e916433b8
commit 10e3a00777
5 changed files with 59 additions and 8 deletions

View file

@ -42,9 +42,12 @@
;; ORIGINAL source is kept for printing; only the compiled pattern is translated.
(define (prop-class name)
(cond
;; L/Alpha: ASCII letters + any non-ASCII codepoint (UTF-8 high
;; bytes count as letters, so ^\p{L}+$ accepts accented words). N/Z stay ASCII-only.
((or (string=? name "L") (string=? name "Alpha")) "a-zA-Z\\x80-\\x{10FFFF}")
;; L/Alpha: ASCII letters + non-ASCII up to just below the UTF-16 surrogate gap
;; (D800). This covers essentially every real letter (Latin/Greek/Cyrillic/CJK/…
;; live below D800); the supplementary planes above it are rare and a range that
;; reaches them makes irregex's char-set construction call integer->char on a
;; surrogate and crash. N/Z stay ASCII-only.
((or (string=? name "L") (string=? name "Alpha")) "a-zA-Z\\x80-\\x{D7FF}")
((string=? name "Lu") "A-Z")
((string=? name "Ll") "a-z")
((or (string=? name "N") (string=? name "Nd") (string=? name "Digit")) "0-9")