Chez Phase 2 (inc X): #inst / #uuid literals + java.time (jolt-at0a)
The analyzer lowers a #inst/#uuid tagged form to a :inst/:uuid IR leaf, mirroring the existing :regex node: the Janet back end punts to the interpreter (its data-readers parse the literal, so seed behavior is unchanged), the Chez back end emits jolt-inst-from-string / jolt-uuid-from-string. host/chez/inst-time.ss is the Chez-native value layer: a jinst record holding epoch ms (RFC3339 parsed via Hinnant civil/days math, with Clojure's partial defaults and +/-hh:mm offsets), wired into jolt-get (so the overlay inst?/inst-ms read it), jolt= / jolt-hash (instant identity as a map key), pr-str (#inst "...-00:00"), str, type, and instance? java.util.Date. The java.time surface (DateTimeFormatter ofPattern/ISO_LOCAL_DATE_TIME/ofLocalized*, the pattern engine, Instant, ZoneId, LocalDateTime, FormatStyle, Locale, Date) ports java_base.janet over host-static.ss's registries. Corpus 2202->2238, 0 new divergences; clears the whole 'unsupported form' emit-fail bucket. Full Janet gate green (analyzer/backend changes are behaviour-preserving — #inst still parses through the interpreter's data-readers on the seed).
This commit is contained in:
parent
62e636e52c
commit
c70f3bae34
10 changed files with 418 additions and 1 deletions
|
|
@ -22,6 +22,7 @@
|
|||
form-literal? form-elements form-vec-items
|
||||
form-map-pairs form-set-items form-special? compile-ns
|
||||
form-regex? form-regex-source
|
||||
form-inst? form-inst-source form-uuid? form-uuid-source
|
||||
form-macro? form-expand-1 resolve-global
|
||||
form-sym-meta host-intern! form-syntax-quote-lower
|
||||
record-type? record-ctor-key form-position late-bind?]]))
|
||||
|
|
@ -431,4 +432,9 @@
|
|||
;; (interpreter compiles via the seed PEG engine); the Chez back end emits a
|
||||
;; jolt-regex value over the vendored irregex.
|
||||
(form-regex? form) {:op :regex :source (form-regex-source form)}
|
||||
;; #inst / #uuid literals -> :inst / :uuid IR leaves. Like :regex, the Janet
|
||||
;; back end punts (the interpreter's data-readers parse them); the Chez back
|
||||
;; end emits a runtime inst/uuid value (host/chez/inst-time.ss).
|
||||
(form-inst? form) {:op :inst :source (form-inst-source form)}
|
||||
(form-uuid? form) {:op :uuid :source (form-uuid-source form)}
|
||||
:else (uncompilable "unsupported form"))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue