Phase 6 followup: fix #? reader conditional :default fallback

- reader.janet: read-reader-conditional now falls back to :default
  when :clj branch is not matched (iterates clauses a second time)
- test/phase6-test.janet: restore :default tests for #? and #?@
  (#? :default fallback, #?@ :default fallback) — all 6 assertions pass
This commit is contained in:
Yogthos 2026-06-02 22:00:08 -04:00
parent fbddf625b4
commit f410f5c48b
2 changed files with 12 additions and 0 deletions

View file

@ -299,6 +299,15 @@
(set result (in form (+ i 1)))
(set i (length form)))
(++ i)))
# Fallback to :default if :clj not matched
(when (nil? result)
(set i 0)
(while (< i (length form))
(if (= (in form i) :default)
(do
(set result (in form (+ i 1)))
(set i (length form)))
(++ i))))
(if splice?
# #?@ splicing: resolve :clj branch, wrap for splice
(let [items (if (nil? result)