girouette

https://github.com/green-coder/girouette
West 2021-04-13T07:12:16.017300Z

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.

2021-04-13T07:13:12.017500Z

Hi. The hiccup-tag-grammar is for parsing the keywords inside a hiccup structure. You probably don't need to touch it.

West 2021-04-13T07:32:07.017900Z

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.

2021-04-13T07:34:36.018100Z

> Sorry, the analyzer is not so easy to use. Yes ..

West 2021-04-13T08:42:30.018300Z

I got it!!

West 2021-04-13T08:49:12.019Z

Now I just gotta get the regex to work right.

2021-04-13T08:49:36.019200Z

What regex?

West 2021-04-13T08:50:15.019400Z

(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]+"))})

West 2021-04-13T08:51:12.019600Z

I think this does it though, maybe there's a more elegant way to do that.

2021-04-13T08:51:33.019800Z

I may have time to take a look tonight.