sjacket
sjacket copied to clipboard
Allow keywords with intervening :
It looks like I introduced an issue in c0b74d9bc6d052d18122461990d6b5e7d9f4eec3 that is the root cause for technomancy/leiningen#1779
I suspect the original reason for disallowing the :
character had something to do with handling ::foo
-style keywords, but will need to dig in further to confirm.
Another input that ends up with an unexpected
node: :li#last
:
user=> (require '[net.cgrand.sjacket.parser :as p])
nil
user=> (->> ":li#last" p/parser)
#net.cgrand.parsley.Node{:tag :net.cgrand.sjacket.parser/root, :content [#net.cgrand.parsley.Node{:tag :keyword, :content [":" #net.cgrand.parsley.Node{:tag :net.cgrand.parsley/unexpected, :content ["li#"]} #net.cgrand.parsley.Node{:tag :name, :content ["last"]}]}]}
user=> (->> ":li#last" p/parser :content first :content)
[":" #net.cgrand.parsley.Node{:tag :net.cgrand.parsley/unexpected, :content ["li#"]} #net.cgrand.parsley.Node{:tag :name, :content ["last"]}]
What we probably want instead is more similar to the parsing of :li-last
:
user=> (->> ":li-last" p/parser :content first :content)
[":" #net.cgrand.parsley.Node{:tag :name, :content ["li-last"]}]
@trptcolin Is this the same issue described on the mailing list in May 2013?
Definitely a similar issue, and the same outcome, though I think the specific cause & details are different.
Thanks for the nudge, PR in place now.
Any hope of getting #23 merged in? Lots of people seem to be affected by this especially when doing any work with enlive or hiccup, myself included. I'm posting here because there seems to be more visibility on this thread.