-
Notifications
You must be signed in to change notification settings - Fork 0
Fix parsing of default namespaces' tags from gobbling up data #3
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
Conversation
I tried out a few things in the REPL: ~> clj
Clojure 1.12.1
user=> {:foo "bar" :baz "qux"}
{:foo "bar", :baz "qux"}
user=> #:thingy{:foo "bar" :baz "qux"}
#:thingy{:foo "bar", :baz "qux"}
user=> #:thingy{:foo "bar" :other/baz "qux"}
{:thingy/foo "bar", :other/baz "qux"}
user=> #:thingy{:foo "bar" :other/baz "qux" :quux "I forgot the next one"}
{:thingy/foo "bar", :other/baz "qux", :thingy/quux "I forgot the next one"}
user=> #:thingy {:foo "bar" :other/baz "qux" :quux "I forgot the next one"}
{:thingy/foo "bar", :other/baz "qux", :thingy/quux "I forgot the next one"} So yeah, it seems spaces are OK. The only other variant it might be good to make sure your code covers is the non-default namespaced key where it should preserve the key's namespace and not impose the default (the |
4ea7aff
to
bbf95d7
Compare
user=> #:thingy{:foo "bar" :other/baz "qux" :quux "I forgot the next one"}
{:thingy/foo "bar", :other/baz "qux", :thingy/quux "I forgot the next one"} I don't think it's actually possible for this crate to allocate a new struct with resolved namespaces like that without causing huge breaking changes and changing the way memory is allocated. This requires creating a new allocated String to create the &str reference, which would potentially cause issues on no_std environments. All the data is read and put into a usable structure though. What I did do is add a convenient clojure-reader/examples/get-nth.rs Lines 19 to 31 in bbf95d7
|
Seems like it works then! Does this cover things like |
1aa9bfa
to
1743155
Compare
clojure-reader/examples/get-nth.rs Lines 32 to 43 in 1743155
The underlying data can be processed in any way you want, and hopefully For data that rust can represent, we already have fully automatic Serde: clojure-reader/examples/serde.rs Lines 5 to 25 in b00e51e
The test suite should show examples of everything that's possible |
Sorry for my delayed responses. I'm in the middle of an international move. I will try this out as soon as I can! |
efbb0f6
to
fc11cca
Compare
Added a lot more test coverage trying to hit edge cases, as well as implemented I will bump to 0.4 after this, if there's no issues. |
fc11cca
to
b1ed736
Compare
b1ed736
to
133484f
Compare
50f514b
to
cf56974
Compare
Fixes #2