Skip to content

Replace sjacket/parsley with clojure.tools.reader#216

Open
bbatsov wants to merge 1 commit intomainfrom
replace-sjacket-with-tools-reader
Open

Replace sjacket/parsley with clojure.tools.reader#216
bbatsov wants to merge 1 commit intomainfrom
replace-sjacket-with-tools-reader

Conversation

@bbatsov
Copy link
Copy Markdown
Collaborator

@bbatsov bbatsov commented Feb 23, 2026

sjacket and parsley have been unmaintained since ~2013 and don't handle modern Clojure reader syntax — namespaced maps (#::{}), tagged literals, reader conditionals, etc. This causes #172 and #200.

This replaces both with org.clojure/tools.reader, which is actively maintained and tracks the language by definition. The internal parsing in reply.parsing is rewritten but the public API (parsed-forms) is unchanged, so no callers need updating.

The key change is a custom position-tracking reader (make-tracking-reader) that implements the tools.reader protocols directly, avoiding the indexing reader's unreliable position reporting at EOF boundaries. Incomplete forms are detected via :eof exceptions from r/read, and syntax errors are passed through as form strings so the REPL displays them as before.

All existing tests pass on Clojure 1.8 through 1.12.

Fixes #172, fixes #200

sjacket and parsley have been unmaintained since ~2013 and don't support
modern Clojure syntax like namespaced maps (#::{}) and tagged literals,
causing issues #172 and #200.

Replace them with clojure.tools.reader which is actively maintained and
tracks the language by definition. The public API (parsed-forms) is
unchanged — only the internal parsing mechanism is rewritten.
@bbatsov
Copy link
Copy Markdown
Collaborator Author

bbatsov commented Feb 23, 2026

I forgot to mention that probably using https://github.com/borkdude/edamame would have made the code a bit simpler, but I felt that tools.reader was more in line with the spirit of REPLy of being a more foundational library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No support for auto-resolved namepaced maps EOF exception with keywords with % character

1 participant