Liking cljdoc? Tell your friends :D

cljstyle.format.zloc

Common utility functions for using rewrite-clj zippers and editing forms.

Common utility functions for using rewrite-clj zippers and editing forms.
raw docstring

comment?clj

(comment? zloc)

True if the node at this location is a comment.

True if the node at this location is a comment.
sourceraw docstring

discard-macro?clj

(discard-macro? zloc)

True if the node at this location is a discard reader macro.

True if the node at this location is a discard reader macro.
sourceraw docstring

eat-whitespaceclj

(eat-whitespace zloc)

Eat whitespace characters, leaving the zipper located at the next non-whitespace node.

Eat whitespace characters, leaving the zipper located at the next
non-whitespace node.
sourceraw docstring

edit-scanclj

(edit-scan zloc f)

Scan rightward from the given location, editing nodes by applying the given function. Returns the final zipper location.

Scan rightward from the given location, editing nodes by applying the given
function. Returns the final zipper location.
sourceraw docstring

edit-walkclj

(edit-walk zloc f)

Visit all nodes in zloc by applying the given function. Returns the final zipper location.

Visit all nodes in `zloc` by applying the given function. Returns the final
zipper location.
sourceraw docstring

form-symbolclj

(form-symbol zloc)

Return a name-only symbol for the leftmost node from this location.

Return a name-only symbol for the leftmost node from this location.
sourceraw docstring

form-symbol-fullclj

(form-symbol-full zloc)

Return the symbol in the leftmost node from this location.

Return the symbol in the leftmost node from this location.
sourceraw docstring

ignored-form?clj

(ignored-form? zloc)

True if the node at this location is an ignored form.

True if the node at this location is an ignored form.
sourceraw docstring

keyword?clj

(keyword? zloc)

True if the node at this location is a keyword.

True if the node at this location is a keyword.
sourceraw docstring

line-breakclj

(line-break zloc)

Ensure the node at this location breaks onto a new line. Returns the zipper at the location following the whitespace, if there is one.

Ensure the node at this location breaks onto a new line. Returns the zipper
at the location following the whitespace, if there is one.
sourceraw docstring

line-joinclj

(line-join zloc)

Ensure the node at this location joins onto the same line. Returns the zipper at the location following the whitespace.

Ensure the node at this location joins onto the same line. Returns the
zipper at the location following the whitespace.
sourceraw docstring

move-nclj

(move-n zloc move n)

Repeatedly move in a direction n times.

Repeatedly move in a direction `n` times.
sourceraw docstring

multiline?clj

(multiline? zloc)

True if the form at this location spans more than one line.

True if the form at this location spans more than one line.
sourceraw docstring

reader-conditional?clj

(reader-conditional? zloc)

True if the node at this location is a reader conditional form.

True if the node at this location is a reader conditional form.
sourceraw docstring

reader-macro?clj

(reader-macro? zloc)

True if the node at this location is a reader macro expression.

True if the node at this location is a reader macro expression.
sourceraw docstring

replace-with-blank-linesclj

(replace-with-blank-lines zloc n)

Replace all whitespace at the location with n blank lines.

Replace all whitespace at the location with `n` blank lines.
sourceraw docstring

root?clj

(root? zloc)

True if this location is the root node.

True if this location is the root node.
sourceraw docstring

safe-editclj

(safe-edit f zloc & args)

Wrap an editing function with error handling logic which will capture information about the surrounding form and the cause of the failure.

Wrap an editing function with error handling logic which will capture
information about the surrounding form and the cause of the failure.
sourceraw docstring

skip-nextclj

(skip-next zloc)

Like z/next*, but skips the current location instead of visiting and descending into it.

Like `z/next*`, but skips the current location instead of visiting and
descending into it.
sourceraw docstring

skip-whitespaceclj

(skip-whitespace zloc)

Skip to the location of the next non-whitespace node.

Skip to the location of the next non-whitespace node.
sourceraw docstring

space?clj

(space? zloc)

True if the node at this location is whitespace and not a line break character.

True if the node at this location is whitespace and _not_ a line break
character.
sourceraw docstring

string?clj

(string? zloc)

True if the node at this location is a string.

True if the node at this location is a string.
sourceraw docstring

syntax-quoted?clj

(syntax-quoted? zloc)

True if the location is inside a macro syntax quote.

True if the location is inside a macro syntax quote.
sourceraw docstring

token-valueclj

(token-value zloc)

Return the s-expression form of the token at this location.

Return the s-expression form of the token at this location.
sourceraw docstring

token?clj

(token? zloc)

True if the node at this location is a token.

True if the node at this location is a token.
sourceraw docstring

unwrap-metaclj

(unwrap-meta zloc)

If this location is a metadata node, recursively unwrap it and return the location of the nested value form. Otherwise returns the location unchanged.

If this location is a metadata node, recursively unwrap it and return the
location of the nested value form. Otherwise returns the location unchanged.
sourceraw docstring

whitespace-after?clj

(whitespace-after? match? zloc)

True if the location is a whitespace node preceding a location matching match?.

True if the location is a whitespace node preceding a location matching
`match?`.
sourceraw docstring

whitespace-before?clj

(whitespace-before? match? zloc)

True if the location is a whitespace node preceding a location matching match?.

True if the location is a whitespace node preceding a location matching
`match?`.
sourceraw docstring

whitespace-between?clj

(whitespace-between? pre? post? zloc)

True if the location is whitespace between locations matching pre? and post?, with nothing but whitespace between.

True if the location is whitespace between locations matching `pre?` and
`post?`, with nothing but whitespace between.
sourceraw docstring

zprnclj

(zprn zloc tag)

Print a zipper location for debugging purposes. Returns the location unchanged.

Print a zipper location for debugging purposes. Returns the
location unchanged.
sourceraw docstring

zstrclj

(zstr zloc)

Return the string representation of the nodes at the given location.

Return the string representation of the nodes at the given location.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close