Fork me on GitHub
#instaparse
<
2021-06-09
>
Ed11:06:01

So I fiddled with my grammar a bit, so it captured some more strings than I needed to actually do the transformations I wanted to do using regexes, and the recursive printer ended up being

(defn write-tag [writer template]
  (if (vector? template)
    (doseq [s (next template)]
      (write-tag writer s))
    (.write writer template))
  writer)

(defn write-template [template]
  (.toString (write-tag (StringWriter.) template)))
Simples ... should have just tried to write it in the first place 😉

3