Fork me on GitHub
#parinfer
<
2020-09-16
>
dominicm06:09:08

I keep meaning to check that out.

dominicm06:09:06

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

sogaiu07:09:45

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

sogaiu07:09:44

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

sogaiu08:09:49

(parse "^{:a 1} [:b :c]")
#_ [[:special-char "^"]
    [:collection
     [:delimiter "{"] [:keyword ":a"] [:whitespace " "]
     [:number "1"] [:delimiter "}"]]
    [:whitespace " "]
    [:collection
     [: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.

sogaiu08:09:35

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

sekao08:09:21

@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

sekao08:09:31

@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

sogaiu08:09:04

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

sogaiu08:09:13

fwiw: https://github.com/carocad/parcera/commit/bcad8cf10bdea4435294e6b010b80ee7a0e37634 i've not looked into this but found it interesting that parcera used to use vectors.