Open PEZ opened 1 month ago
I now checked the rewrite-clj issue tracker and couldn't find anything about this. But the issue search engine isn't exactly stellar, so I may just have missed it.
Hmmm... It is not this simple. This works fine:
#_{zprint/zprint {:mvn/version "1.2.9"}}
(require '[zprint.core :as zp])
(zp/czprint-str "^[Long] a" 40 {:parse-string-all? true})
;;=> "^[Long] a"
(zp/czprint-str "^Long/1 a" 40 {:parse-string-all? true})
;;=> "^Long/1 a"
I tried this in Clojure. So it may have something to do with that Calva uses the ClojureScript libraries. (And Clojure pre-11, come to think of it.) I'll go check from that end of things and see if I have just bothered you for no reason.
Hello again. I'm sorry for this getting messy. I now think I know why the above test didn't reproduce the problem. Right before that, I had tried this:
#_{rewrite-clj/rewrite-clj {:mvn/version "1.1.48"}}
(require '[rewrite-clj.zip :as z])
(-> (z/of-string "^[Long] a")
z/sexpr)
(-> (z/of-string "^Long/1 a")
z/sexpr)
And that made zprint use rewrite-clj 1.1.48
. And we can read in the CHANGELOG for rewrite-cljs on v1.1.48 (which I of course should have done before I hunted in the issue tracker 🤦):
Add support for Clojure 1.12 array class syntax
Using zprint without first requiring the fixed rewrite-clj reproduces the problem.
Thank you very much for letting me know about this. I had missed this change in Clojure 1.12, and the corresponding upgrade required in rewrite-clj. In my tests as well, rewrite-clj 1.1.48
solves this problem. I will hasten the release of zprint 1.3.0
with the new rewrite-clj to to make this solution available to everyone. Again, many thanks!
Hi! Clojure 1.12 adds new Array class syntax. Example:
Unfortunatelly zprint croaks on this:
And this makes Calva sad.
I haven't checked if this is upstream on rewrite-clj, but adding here to put it on your radar, unless it wasn't already.