-
-
Notifications
You must be signed in to change notification settings - Fork 293
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
Keywords with double colons can't be parsed #301
Comments
@dhleong Thank you. To be sure, can you paste a full self-consistent example? Your example
|
Interesting. It does work fine in a cljs repl via
It's not a namespace, since there's that
I suppose if you're just using the clojure reader to parse the file contents into list or something, then there may not be much that can reasonably be done here besides formatting the error.... |
I'll check if there's something in rewrite-clj that I can tweak. If this is in tools.reader, I'm not sure if it's easily fixable. |
@dhleong It seems tools.reader has issues with this: |
@dhleong I modified the keyword reading a bit, so it should work now. Can you test if this work for you? E.g. with clj:
A new Mac binary can be downloaded here: |
That worked, thanks! I was able to run without error against the e6f6bf0 commit:
Thanks so much for your help! |
A while ago @borkdude mentioned clj-kondo/clj-kondo#301 Thought I'd add some small tests to see how rewrite-cljc behaves - seems to handle the garden-style syntax just fine.
Turns out I was accidentally using clojure.tools.reader instead of clojure.tools.read.edn. I made a decision to use clojure.tools.reader.edn because it is safe in that it does not execute code. When I corrected my reader, garden-style keywords parsing failed. After adopting borkdude's fix for clj-kondo/clj-kondo#301, we are good again.
version
v2019.06.16-alpha
platform
macOS 10.14.5
problem
I'm using a garden-based CSS solution in clojurescript, and it's supported keywords like
:&::before
without problem (the & refers to the parent "node") but kondo barfs on it, saying it can't parse the file due to things like that being an invalid keyword.repro
I think having any such keyword in a file would produce this
expected behavior
At least not barf on the keyword; possibly use an
info
to inform, if you like, but the reader happily accepts it and uses it.actual behavior
Error:
(from ALE)
The text was updated successfully, but these errors were encountered: