clojureedn

Is there a good way to preserve comments while modifying clojure code?


I am reading a clojure source code file using clojure's read-string. However single line comments are naturally ignored by the reader. When I generate new source code, those comments are no there anymore.

Is there a way I can preserve these comments ?


Solution

  • Rewrite-clj https://github.com/xsc/rewrite-clj seems perfect for what you are trying to do? It preserves comments.