rewrite-clj.node

added in 0.4.0

child-sexprs

(child-sexprs node)

Get all child s-expressions for the given node.

children

(children _)

Get child nodes.

coerce

(coerce _)

comma-node

(comma-node s)

Create comma node.

comma-separated

(comma-separated nodes)

Interleave the given seq of nodes with ", " nodes.

comma?

(comma? node)

Check whether a node represents a comma.

comment-node

(comment-node s)

Create node representing an EDN comment.

comment?

(comment? node)

Check whether a node represents a comment.

deref-node

(deref-node children)

Create node representing the dereferencing of a form. (@...) Takes either a seq of nodes or a single one.

eval-node

(eval-node children)

Create node representing an inline evaluation. (#=...) Takes either a seq of nodes or a single one.

fn-node

(fn-node children)

Create node representing an anonymous function.

forms-node

(forms-node children)

Create top-level node wrapping multiple children (equals an implicit do on the top-level).

inner?

(inner? _)

Check whether the node can contain children.

integer-node

(integer-node value)(integer-node value base)

Create node for an EDN integer with the given base.

keyword-node

(keyword-node k & [namespaced?])

Create node representing a keyword. If namespaced? is given as true a keyword à la ::x or ::ns/x (i.e. namespaced/aliased) is generated.

leader-length

(leader-length _)

How many characters appear before children?

length

(length _)

Get number of characters for the string version of this node.

line-separated

(line-separated nodes)

Interleave the given seq of nodes with newline nodes.

linebreak?

(linebreak? node)

Check whether a ndoe represents linebreaks.

list-node

(list-node children)

Create a node representing an EDN list.

map-node

(map-node children)

Create a node representing an EDN map.

meta-node

(meta-node children)(meta-node metadata data)

Create node representing a form and its metadata.

newline-node

(newline-node s)

Create newline node.

newlines

(newlines n)

Create node representing the given number of newline characters.

printable-only?

(printable-only? _)

Return true if the node cannot be converted to an s-expression element.

quote-node

(quote-node children)

Create node representing a quoted form. Takes either a seq of nodes or a single one.

raw-meta-node

(raw-meta-node children)(raw-meta-node metadata data)

Create node representing a form and its metadata using the #^ prefix.

reader-macro-node

(reader-macro-node children)(reader-macro-node macro-node form-node)

Create node representing a reader macro. (#... ...)

replace-children

(replace-children _ children)

Replace the node’s children.

set-node

(set-node children)

Create a node representing an EDN set.

sexpr

(sexpr _)

Convert node to s-expression.

sexprs

(sexprs nodes)

Given a seq of nodes, convert those that represent s-expressions to the respective forms.

spaces

(spaces n)

Create node representing the given number of spaces.

string

(string _)

Convert node to printable string.

string-node

(string-node lines)

Create node representing a string value. Takes either a seq of strings or a single one.

syntax-quote-node

(syntax-quote-node children)

Create node representing a syntax-quoted form. Takes either a seq of nodes or a single one.

tag

(tag _)

Keyword representing the type of the node.

token-node

(token-node value & [string-value])

Create node for an unspecified EDN token.

uneval-node

(uneval-node children)

Create node representing an EDN uneval #_ form.

unquote-node

(unquote-node children)

Create node representing an unquoted form. (~...) Takes either a seq of nodes or a single one.

unquote-splicing-node

(unquote-splicing-node children)

Create node representing an unquote-spliced form. (~@...) Takes either a seq of nodes or a single one.

value

deprecated in 0.4.0

(value node)

DEPRECATED: Get first child as a pair of tag/sexpr (if inner node), or just the node’s own sexpr. (use explicit analysis of children child-sexprs instead)

var-node

(var-node children)

Create node representing a var. Takes either a seq of nodes or a single one.

vector-node

(vector-node children)

Create a node representing an EDN vector.

whitespace-node

(whitespace-node s)

Create whitespace node.

whitespace-nodes

(whitespace-nodes s)

Convert a string of whitespace to whitespace/newline nodes.

whitespace-or-comment?

(whitespace-or-comment? node)

Check whether the given node represents whitespace or comment.

whitespace?

(whitespace? node)

Check whether a node represents whitespace.