Phase 8: REPL, printing, source maps, and nREPL server

- IPrintWithWriter protocol + CljElixir.Printer module with pr-str,
  print-str, pr, prn for all BEAM types (EDN-like output)
- Source-mapped error messages: line/col metadata from reader now
  propagated through transformer into Elixir AST for accurate error
  locations in .clje files
- Interactive REPL (mix clje.repl) with multi-line input detection,
  history, bindings persistence, and pr-str formatted output
- nREPL server (mix clje.nrepl) with TCP transport, Bencode wire
  protocol, session management, and core operations (clone, close,
  eval, describe, ls-sessions, load-file, interrupt, completions).
  Writes .nrepl-port for editor auto-discovery.

92 new tests (699 total, 0 failures).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 11:03:10 -04:00
parent d8719b6d48
commit 7e82efd7ec
14 changed files with 1946 additions and 73 deletions
+4 -4
View File
@@ -1079,12 +1079,12 @@ defmodule CljElixir.TransformerTest do
describe "dynamic vars" do
test "*self* produces self() call" do
ast = transform("*self*")
assert ast == {:self, [], []}
assert match?({:self, _, []}, ast)
end
test "*node* produces node() call" do
ast = transform("*node*")
assert ast == {:node, [], []}
assert match?({:node, _, []}, ast)
end
test "*self* evaluates to current process" do
@@ -1131,12 +1131,12 @@ defmodule CljElixir.TransformerTest do
describe "symbols" do
test "plain symbol becomes variable" do
ast = transform("x")
assert ast == {:x, [], nil}
assert match?({:x, _, nil}, ast)
end
test "symbol with hyphens becomes munged variable" do
ast = transform("my-var")
assert ast == {:my_var, [], nil}
assert match?({:my_var, _, nil}, ast)
end
test "true symbol becomes true literal" do