Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for | in keywords and symbols, support of namespaced maps, special support for :nil/:true/:false, fixes, formatting, deps bump #44

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

prepor
Copy link

@prepor prepor commented Mar 22, 2024

Hi! Thank you for this package!

Yes, this PR is about many different things, let me know please, if it's better to make multiple PRs. Nevertheless, changes are split into individual commits.

  1. It adds support for | in symbols and keywords. https://github.com/edn-format/edn doesn't mention it in the list of allowed symbols but Clojure support them in EDN reader https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/EdnReader.java#L28 and in the language.

I personally love to use them for "or" meaning, like :number|string. It's a blocker for me, because I can't parse my EDN files currently.

  1. It adds support for Namespaced Maps introduced in Clojure 1.9 (https://clojure.org/reference/reader#_maps).

Before this PR Eden parsed such maps as tag. That was incorrect because tag can't start from :.

  1. It adds special cases for :nil, :true and :false keywords. Before it was impossible to distinguish them from corresponding "special symbols", like Eden.decode!("true") == Eden.decode!(":true") => true.

It now decodes them to {:keyword, nil/true/false} and support of encoding of such structure.

  1. It fixes some tests (sets, float)

  2. Format code with mix format mix.exs "lib/**/*.{ex,exs}" "test/**/*.{ex,exs}"

  3. Bumps deps & removes exreloader (it doesn't compile for me)

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.

1 participant