Replace sjacket/parsley with clojure.tools.reader#216
Open
Conversation
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.
Collaborator
Author
|
I forgot to mention that probably using https://github.com/borkdude/edamame would have made the code a bit simpler, but I felt that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inreply.parsingis 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:eofexceptions fromr/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