Well, I'm a little stumped, I gotta say. It was certainly fun refactoring the processor. I'm gonna sleep on this one and maybe I'll figure out how instaparse works.
Hi. The hiccup-tag-grammar is for parsing the keywords inside a hiccup structure. You probably don't need to touch it.
I see. So right now I'm trying to figure out where exactly the program takes in the strings. It seems like cljs.analyzer.api
is the library in gather-css-classes
that does the parsing. I found that it does something called passes
after taking in the whole file. So each of these passes
has some regex and destructuring for keywords and strings, it would seem that all I need to do is add some regex or something to take symbols in. That's where I'm stuck.
> Sorry, the analyzer is not so easy to use. Yes ..
I got it!!
Now I just gotta get the regex to work right.
What regex?
(def receive-hook-fn
{:keyword #(->> (name %)
(re-seq #"\.[^\.#]+")
(map (fn [s] (subs s 1))))
:string #(->> (str/split % #" ")
(remove str/blank?))
:symbol #(->> (name %)
(re-seq #"[\S]+"))})
I think this does it though, maybe there's a more elegant way to do that.
I may have time to take a look tonight.