feat: 80/80 unit tests, real-world examples (FizzBuzz, WordFreq)

- Emitter: def registry (definedGlobals) for symbol emit distinction
- Emitter: cond emits return statements
- Emitter: reduce wraps named functions in closure adapter
- Emitter: clojure.string/* function mappings (split, lower-case, etc.)
- Emitter: statement detection for echo cljRepr wrapping
- Runtime: cljGet supports default value (3 args)
- Runtime: cljStrSplit supports regex patterns via re module
- Examples: fizzbuzz.clj and wordfreq.clj both compile and run correctly
- Tests: emit symbol / emit mangled symbol now pass (80/80)
- Compliance: 233/233 (100%) maintained
This commit is contained in:
2026-05-11 10:08:46 +03:00
parent 4afef5a264
commit 456636700c
6 changed files with 169 additions and 43 deletions
+2
View File
@@ -40,11 +40,13 @@ suite "Emitter - Basic Values":
check code == "cljKeyword(\"foo\")"
test "emit symbol":
registerGlobal("x")
let v = cljSymbol("x")
let code = emitExpr(v)
check code == "x"
test "emit mangled symbol":
registerGlobal("my-var")
let v = cljSymbol("my-var")
let code = emitExpr(v)
check code == "my_var"