Fork me on GitHub

I keep meaning to check that out.


I suppose it's not been used for general editors, only your clojure ones?


didn't know this: > Acts as a general purpose clojure parser, because its parse function returns the code a hiccup-style data structure, not merely a string. In fact, adjusting parens/indentation is just an optional step


so i'll ask dominicm's question before he does -- how does it handle metadata?


(parse "^{:a 1} [:b :c]")
#_ [[:special-char "^"]
     [:delimiter "{"] [:keyword ":a"] [:whitespace " "]
     [:number "1"] [:delimiter "}"]]
    [:whitespace " "]
     [:delimiter "["] [:keyword ":b"] [:whitespace " "]
     [:keyword ":c"] [:delimiter "]"]]]
so it looks like it doesn't do what rewrite-clj or parcera does, which i think makes going through the results easier.


as in, one doesn't have to descend into something that wraps what the metadata applies to.


@dominicm it's written in clojure (cljc) so it depends on what the editor is written in. i made it for paravim in particular but any editor written in clojure could use it


@sogaiu yeah it's not a full-blown reader like tools.reader so it doesn't actually know what metadata is, it just parses the literal syntax. for this purpose i think that's the way to go. i used to use tools.reader for this kind of stuff and had all kinds of problems


@sekao right -- parcera doesn't do the reader thing either. i think it makes sense.


fwiw: i've not looked into this but found it interesting that parcera used to use vectors.