Phase 6: comprehensive compile-mode tests + bug fixes

47 new compile-mode tests: collections, math, predicates, comparison,
seq operations (map/filter/reduce/take/drop), special forms (let/if/loop/
try/quote), macros (defn/when/and/or/fn/if-let), complex nesting.

Bugs fixed:
- emit-vector-expr: use (tuple ...) instead of bare tuple
  (Janet eval treats bare tuples as function calls)
- make-symbol: / at position 0 → unqualified symbol
  (was parsing as {:ns "" :name ""})
- core-renames: add missing fn? entry
This commit is contained in:
Yogthos 2026-06-02 16:10:11 -04:00
parent 4a962cf6f3
commit c366963256
3 changed files with 84 additions and 2 deletions

View file

@ -25,6 +25,7 @@
"some?" "core-some?"
"string?" "core-string?"
"number?" "core-number?"
"fn?" "core-fn?"
"keyword?" "core-keyword?"
"symbol?" "core-symbol?"
"vector?" "core-vector?"
@ -664,7 +665,7 @@
(tuple/slice (tuple ;exprs)))
(defn- emit-vector-expr [items]
(def exprs @[])
(def exprs @['tuple])
(each item items (array/push exprs (emit-expr item)))
(tuple/slice (tuple ;exprs)))

View file

@ -70,7 +70,7 @@
"Create a Jolt symbol struct."
[name]
(let [slash (string/find "/" name)]
(if slash
(if (and slash (> slash 0))
{:jolt/type :symbol
:ns (string/slice name 0 slash)
:name (string/slice name (+ slash 1))}