(->root-string zloc)
DEPRECATED. Use root-string
instead.
DEPRECATED. Use `root-string` instead.
(->string zloc)
DEPRECATED. Use string
instead.
DEPRECATED. Use `string` instead.
(append-child zloc item)
Insert item as last child of the current node. Will insert a space if necessary.
Insert item as last child of the current node. Will insert a space if necessary.
(append-newline zloc & [n])
Append a newline node representing the given number of linebreaks (default: 1).
DEPRECATED: use 'insert-newline-right' instead.
Append a newline node representing the given number of linebreaks (default: 1). DEPRECATED: use 'insert-newline-right' instead.
(append-space zloc & [n])
Append a whitespace node representing the given number of spaces (default: 1).
DEPRECATED: use 'insert-space-right' instead.
Append a whitespace node representing the given number of spaces (default: 1). DEPRECATED: use 'insert-space-right' instead.
(assoc zloc k v)
Set map/seq element to the given value.
Set map/seq element to the given value.
(child-sexprs zloc)
Get children as s-expressions.
Get children as s-expressions.
(down zloc)
Move down to next non-whitespace/non-comment location.
Move down to next non-whitespace/non-comment location.
(down* G__3487)
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/down' on the given arguments.
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/down' on the given arguments.
(edit zloc f & args)
Apply the given function to the s-expression at the given location, using its result to replace the node there. (The result will be coerced to a node if possible.)
Apply the given function to the s-expression at the given location, using its result to replace the node there. (The result will be coerced to a node if possible.)
(edit* loc f & args)
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/edit' on the given arguments.
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/edit' on the given arguments.
(edit-> zloc & body)
Like ->
, applying the given function to the current zipper location.
The resulting zipper will be located at the same path (i.e. the same
number of downwards and right movements from the root) as the original
node.
Like `->`, applying the given function to the current zipper location. The resulting zipper will be located at the same path (i.e. the same number of downwards and right movements from the root) as the original node.
(edit->> zloc & body)
Like ->>
, applying the given function to the current zipper location.
The resulting zipper will be located at the same path (i.e. the same
number of downwards and right movements from the root) as the original
node.
Like `->>`, applying the given function to the current zipper location. The resulting zipper will be located at the same path (i.e. the same number of downwards and right movements from the root) as the original node.
(edit-node zloc f)
Apply the given function to the current zipper location. The resulting zipper will be located at the same path (i.e. the same number of downwards and right movements from the root) as the original node.
Apply the given function to the current zipper location. The resulting zipper will be located at the same path (i.e. the same number of downwards and right movements from the root) as the original node.
(edn node)
(edn node {:keys [track-position?] :as options})
Create zipper over the given Clojure/EDN node and move to the first non-whitespace/non-comment child.
If :track-position?
is set, this will create a custom zipper that will
return the current row/column using cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.zip/position
. (Note that
this custom zipper will be incompatible with clojure.zip
's functions.)
Create zipper over the given Clojure/EDN node and move to the first non-whitespace/non-comment child. If `:track-position?` is set, this will create a custom zipper that will return the current row/column using `cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.zip/position`. (Note that this custom zipper will be incompatible with `clojure.zip`'s functions.)
(edn* node)
(edn* node {:keys [track-position?]})
Create zipper over the given Clojure/EDN node.
If :track-position?
is set, this will create a custom zipper that will
return the current row/column using cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.zip/position
. (Note that
this custom zipper will be incompatible with clojure.zip
's functions.)
Create zipper over the given Clojure/EDN node. If `:track-position?` is set, this will create a custom zipper that will return the current row/column using `cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.zip/position`. (Note that this custom zipper will be incompatible with `clojure.zip`'s functions.)
(end? zloc)
Check whether the given node is at the end of the depth-first traversal.
Check whether the given node is at the end of the depth-first traversal.
(find zloc p?)
(find zloc f p?)
Find node satisfying the given predicate by repeatedly applying the given movement function to the initial zipper location.
Find node satisfying the given predicate by repeatedly applying the given movement function to the initial zipper location.
(find-depth-first zloc p?)
Find node satisfying the given predicate by traversing the zipper in a depth-first way.
Find node satisfying the given predicate by traversing the zipper in a depth-first way.
(find-next zloc p?)
(find-next zloc f p?)
Find node other than the current zipper location matching the given predicate by applying the given movement function to the initial zipper location.
Find node other than the current zipper location matching the given predicate by applying the given movement function to the initial zipper location.
(find-next-depth-first zloc p?)
Find node other than the current zipper location matching the given predicate by traversing the zipper in a depth-first way.
Find node other than the current zipper location matching the given predicate by traversing the zipper in a depth-first way.
(find-next-tag zloc t)
(find-next-tag zloc f t)
Find node other than the current zipper location with the given tag by repeatedly applying the given movement function to the initial zipper location.
Find node other than the current zipper location with the given tag by repeatedly applying the given movement function to the initial zipper location.
(find-next-token zloc p?)
(find-next-token zloc f p?)
Find next token node matching the given predicate by applying the
given movement function to the initial zipper location, defaulting
to right
.
Find next token node matching the given predicate by applying the given movement function to the initial zipper location, defaulting to `right`.
(find-next-value zloc v)
(find-next-value zloc f v)
Find next token node whose value matches the given one by applying the
given movement function to the initial zipper location, defaulting
to right
.
Find next token node whose value matches the given one by applying the given movement function to the initial zipper location, defaulting to `right`.
(find-tag zloc t)
(find-tag zloc f t)
Find node with the given tag by repeatedly applying the given movement function to the initial zipper location.
Find node with the given tag by repeatedly applying the given movement function to the initial zipper location.
(find-token zloc p?)
(find-token zloc f p?)
Find token node matching the given predicate by applying the
given movement function to the initial zipper location, defaulting
to right
.
Find token node matching the given predicate by applying the given movement function to the initial zipper location, defaulting to `right`.
(find-value zloc v)
(find-value zloc f v)
Find token node whose value matches the given one by applying the
given movement function to the initial zipper location, defaulting
to right
.
Find token node whose value matches the given one by applying the given movement function to the initial zipper location, defaulting to `right`.
(get zloc k)
If a map is given, get element with the given key; if a seq is given, get nth element.
If a map is given, get element with the given key; if a seq is given, get nth element.
(insert-child zloc item)
Insert item as first child of the current node. Will insert a space if necessary.
Insert item as first child of the current node. Will insert a space if necessary.
(insert-left zloc item)
Insert item to the right of the left location. Will insert a space if necessary.
Insert item to the right of the left location. Will insert a space if necessary.
(insert-left* G__3526 G__3527)
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/insert-left' on the given arguments.
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/insert-left' on the given arguments.
(insert-right zloc item)
Insert item to the right of the current location. Will insert a space if necessary.
Insert item to the right of the current location. Will insert a space if necessary.
(insert-right* G__3530 G__3531)
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/insert-right' on the given arguments.
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/insert-right' on the given arguments.
(left zloc)
Move left to next non-whitespace/non-comment location.
Move left to next non-whitespace/non-comment location.
(left* G__3512)
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/left' on the given arguments.
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/left' on the given arguments.
(leftmost zloc)
Move to the leftmost non-whitespace/non-comment location.
Move to the leftmost non-whitespace/non-comment location.
(leftmost* G__3519)
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/leftmost' on the given arguments.
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/leftmost' on the given arguments.
(leftmost? zloc)
Check if the given location represents the leftmost non-whitespace/ non-comment one.
Check if the given location represents the leftmost non-whitespace/ non-comment one.
(length zloc)
Get length of printable string for the given zipper location.
Get length of printable string for the given zipper location.
(map f zloc)
Apply function to all value nodes in the given seq node. Iterates over value nodes of maps but over each element of a seq.
Apply function to all value nodes in the given seq node. Iterates over value nodes of maps but over each element of a seq.
(map-keys f zloc)
Apply function to all key nodes of the given map node.
Apply function to all key nodes of the given map node.
(map-vals f zloc)
Apply function to all value nodes of the given map node.
Apply function to all value nodes of the given map node.
(next zloc)
Move to the next non-whitespace/non-comment location in a depth-first manner.
Move to the next non-whitespace/non-comment location in a depth-first manner.
(next* G__3544)
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/next' on the given arguments.
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/next' on the given arguments.
(of-file f)
(of-file f options)
Create zipper from File.
Create zipper from File.
(of-string s)
(of-string s options)
Create zipper from String.
Create zipper from String.
(position loc)
Returns the ones-based [row col] of the start of the current node
Returns the ones-based [row col] of the start of the current node
(postwalk zloc f)
(postwalk zloc p? f)
Perform a depth-first post-order traversal starting at the given zipper location
and apply the given function to each child node. If a predicate p?
is given,
only apply the function to nodes matching it.
Perform a depth-first post-order traversal starting at the given zipper location and apply the given function to each child node. If a predicate `p?` is given, only apply the function to nodes matching it.
(prepend-newline zloc & [n])
Prepend a newline node representing the given number of linebreaks (default: 1).
DEPRECATED: use 'insert-newline-left' instead.
Prepend a newline node representing the given number of linebreaks (default: 1). DEPRECATED: use 'insert-newline-left' instead.
(prepend-space zloc & [n])
Prepend a whitespace node representing the given number of spaces (default: 1).
DEPRECATED: use 'insert-space-left' instead.
Prepend a whitespace node representing the given number of spaces (default: 1). DEPRECATED: use 'insert-space-left' instead.
(prev zloc)
Move to the next non-whitespace/non-comment location in a depth-first manner.
Move to the next non-whitespace/non-comment location in a depth-first manner.
(prev* G__3551)
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/prev' on the given arguments.
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/prev' on the given arguments.
(prewalk zloc f)
(prewalk zloc p? f)
Perform a depth-first pre-order traversal starting at the given zipper location
and apply the given function to each child node. If a predicate p?
is given,
only apply the function to nodes matching it.
Perform a depth-first pre-order traversal starting at the given zipper location and apply the given function to each child node. If a predicate `p?` is given, only apply the function to nodes matching it.
(print zloc & [writer])
Print current zipper location.
Print current zipper location.
(print-root zloc & [writer])
Zip up and print root node.
Zip up and print root node.
(remove zloc)
Remove value at the given zipper location. Returns the first non-whitespace node that would have preceded it in a depth-first walk. Will remove whitespace appropriately.
[1 2 3] => [1 3]
[1 2] => [1]
[1 2] => [2]
[1] => []
[ 1 ] => []
[1 [2 3] 4] => [1 [2 3]]
[1 [2 3] 4] => [[2 3] 4]
If a node is located rightmost, both preceding and trailing spaces are removed, otherwise only trailing spaces are touched. This means that a following element (no matter whether on the same line or not) will end up in the same position (line/column) as the removed one, unless a comment lies between the original node and the neighbour.
Remove value at the given zipper location. Returns the first non-whitespace node that would have preceded it in a depth-first walk. Will remove whitespace appropriately. [1 2 3] => [1 3] [1 2] => [1] [1 2] => [2] [1] => [] [ 1 ] => [] [1 [2 3] 4] => [1 [2 3]] [1 [2 3] 4] => [[2 3] 4] If a node is located rightmost, both preceding and trailing spaces are removed, otherwise only trailing spaces are touched. This means that a following element (no matter whether on the same line or not) will end up in the same position (line/column) as the removed one, _unless_ a comment lies between the original node and the neighbour.
(remove* G__3558)
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/remove' on the given arguments.
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/remove' on the given arguments.
(replace zloc value)
Replace the node at the given location with one representing the given value. (The value will be coerced to a node if possible.)
Replace the node at the given location with one representing the given value. (The value will be coerced to a node if possible.)
(replace* G__3534 G__3535)
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/replace' on the given arguments.
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/replace' on the given arguments.
(right zloc)
Move right to next non-whitespace/non-comment location.
Move right to next non-whitespace/non-comment location.
(right* G__3502)
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/right' on the given arguments.
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/right' on the given arguments.
(rightmost zloc)
Move to the rightmost non-whitespace/non-comment location.
Move to the rightmost non-whitespace/non-comment location.
(rightmost* G__3509)
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/rightmost' on the given arguments.
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/rightmost' on the given arguments.
(rightmost? zloc)
Check if the given location represents the leftmost non-whitespace/ non-comment one.
Check if the given location represents the leftmost non-whitespace/ non-comment one.
(root G__3499)
zips all the way up and returns the root node, reflecting any changes.
zips all the way up and returns the root node, reflecting any changes.
(root-string zloc)
Create string representing the zipped-up zipper.
Create string representing the zipped-up zipper.
(sexpr zloc)
Get sexpr represented by the given node.
Get sexpr represented by the given node.
(skip f p? zloc)
Perform the given movement while the given predicate returns true.
Perform the given movement while the given predicate returns true.
(skip-whitespace zloc)
(skip-whitespace f zloc)
Perform the given movement (default: z/right
) until a non-whitespace/
non-comment node is encountered.
Perform the given movement (default: `z/right`) until a non-whitespace/ non-comment node is encountered.
(skip-whitespace-left zloc)
Move left until a non-whitespace/non-comment node is encountered.
Move left until a non-whitespace/non-comment node is encountered.
(splice zloc)
Splice the given node, i.e. merge its children into the current one
(akin to Clojure's unquote-splicing
macro: ~@...
).
Splice the given node, i.e. merge its children into the current one (akin to Clojure's `unquote-splicing` macro: `~@...`). - if the node is not one that can have children, no modification will be performed. - if the node has no or only whitespace children, it will be removed. - otherwise, splicing will be performed, moving the zipper to the first non-whitespace child afterwards.
(string zloc)
Create string representing the current zipper location.
Create string representing the current zipper location.
(subedit-> zloc & body)
Like ->
, applying modifications to the current sub-tree, zipping
up to the current location afterwards.
Like `->`, applying modifications to the current sub-tree, zipping up to the current location afterwards.
(subedit->> zloc & body)
Like ->>
, applying modifications to the current sub-tree, zipping
up to the current location afterwards.
Like `->>`, applying modifications to the current sub-tree, zipping up to the current location afterwards.
(subedit-node zloc f)
Apply the given function to the current sub-tree. The resulting zipper will be located on the root of the modified sub-tree.
Apply the given function to the current sub-tree. The resulting zipper will be located on the root of the modified sub-tree.
(tag zloc)
Get tag of node at the current zipper location.
Get tag of node at the current zipper location.
(up zloc)
Move up to next non-whitespace/non-comment location.
Move up to next non-whitespace/non-comment location.
(up* G__3496)
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/up' on the given arguments.
Directly call 'cider.inlined-deps.cljfmt.v0v6v1.rewrite-clj.v0v6v0.rewrite-clj.custom-zipper.core/up' on the given arguments.
(value zloc)
DEPRECATED. Return a tag/s-expression pair for inner nodes, or the s-expression itself for leaves.
DEPRECATED. Return a tag/s-expression pair for inner nodes, or the s-expression itself for leaves.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close