Skip to content

Releases: clj-commons/rewrite-clj

Clojars Release 0.3.10

Choose a tag to compare

@xsc xsc released this 21 Nov 21:37

Bugfixes

  • fixes behaviour of end? and next.

Features

  • adds :row/:col to node metadata.

Artifact Coordinates

[rewrite-clj "0.3.10"]

Clojars Release 0.3.9

Choose a tag to compare

@xsc xsc released this 29 Mar 11:33

Bugfixes

  • access to children of quoted forms wasn't possible. (see #6)
  • rewrite-clj.zip/next while at an empty vector moved to the non-existent first child of the vector. (see #5)
  • rewrite-clj.zip/next should return itself if no next element available.

Features

  • rewrite-clj.zip/end? to decide whether the zipper has reached the last non-whitespace node.

Coordinates

[rewrite-clj "0.3.9"]

Clojars Release 0.3.8

Choose a tag to compare

@xsc xsc released this 16 Mar 10:08

This release adds handling of the "do not evaluate" reader macro #_. The nodes have the :uneval node type.

[rewrite-clj "0.3.8"]

Clojars Release 0.3.6

Choose a tag to compare

@xsc xsc released this 08 Feb 14:17

This release upgrades rewrite-clj's dependencies and fixes issues with parsing files containing UTF-8 characters (see xsc/lein-ancient#24).

Clojars Release 0.3.5

Choose a tag to compare

@xsc xsc released this 14 Dec 12:13

This release cleans up the dependency chain and upgrades org.clojure/tools.reader.

Clojars Release 0.3.4

Choose a tag to compare

@xsc xsc released this 02 Nov 12:13

This release updates rewrite-clj's dependencies, most importantly tools.reader. The combinations \return \newline and \return \formfeed are now read as a single newline character.

Clojars Release 0.3.3

Choose a tag to compare

@xsc xsc released this 24 Oct 09:38

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

Choose a tag to compare

@xsc xsc released this 24 Oct 09:30

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

Choose a tag to compare

@xsc xsc released this 07 Oct 19:10

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

Choose a tag to compare

@xsc xsc released this 07 Aug 19:18

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.