Releases: clj-commons/rewrite-clj
Clojars Release 0.3.3
This release fixes the handling of keywords. :abc
, :1.5
, :1.5.0
, ::abc
, ::1.5.0
are now processed correctly by the parser.
Clojars Release 0.3.2
This partially fixes the handling of keywords whose name
isn't a symbol, e.g. :1.5
.
Note: :1.5.1
still throws an exception. Sorry.
Clojars Release 0.3.1
The parse now handles implicitly namespaced keywords by creating a settings map in the :token
node:
(parse-string ":x") ;; => [:token :x]
(parse-string "::x") ;; => [:token :x {:namespaced? true}]
To use this version of rewrite-clj, add the following to the :dependencies
vector in your project.clj
:
[rewrite-clj "0.3.1"]
Clojars Release 0.3.0
This release adds indentation-aware zipper operations (in rewrite-clj.zip.indent
), requiring the addition of the new token type :newline
, as well as having the zipper root node be of type :forms
. This means that projects relying on the old structure have to be revisited!
Indentation can now be propagated through branches spanning multiple lines:
(require '[rewrite-clj.zip :as z] '[rewrite-clj.zip.indent :as i])
(def code
(z/of-string "
{:dependencies [[a \"1.0.0\"]
[b \"0.1.1\"]
[c \"1.2.3\"]]}"))
(-> code
(z/find-value z/next :dependencies)
(z/replace :deps)
z/print-root)
; {:deps [[a "1.0.0"]
; [b "0.1.1"]
; [c "1.2.3"]]}
(-> code
(z/find-value z/next :dependencies)
(i/replace :deps) ;; !!!
z/print-root)
; {:deps [[a "1.0.0"]
; [b "0.1.1"]
; [c "1.2.3"]]}
Additionally, removal now handles whitespaces appropriately and there are some new functions for zipper manipulation/analysis. Click here for a detailed list of changes.
Clojars Release 0.2.0
This release mainly consists of:
- more expressive error handling
- extensions to parser/printer, including:
- multi-line string support
- parsing the whole of a string/file instead of only the first entity
- access to parser/printer via
rewrite-clj.zip
- bugfixes
Use it in your project by putting the following into the :dependencies
vector of your project.clj
:
[rewrite-clj "0.2.0"]
Clojars Release 0.1.0
This is the initial release of rewrite-clj. Enjoy.