rewrite-clj.node.protocols

added in 0.4.0

child-sexprs

(child-sexprs node)

Get all child s-expressions for the given node.

InnerNode

protocol

Protocol for non-leaf EDN/Clojure nodes.

members

children

(children _)

Get child nodes.

inner?

(inner? _)

Check whether the node can contain children.

leader-length

(leader-length _)

How many characters appear before children?

replace-children

(replace-children _ children)

Replace the node’s children.

Node

protocol

Protocol for EDN/Clojure nodes.

members

length

(length _)

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

printable-only?

(printable-only? _)

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

sexpr

(sexpr _)

Convert node to s-expression.

string

(string _)

Convert node to printable string.

tag

(tag _)

Keyword representing the type of the node.

NodeCoerceable

protocol

Protocol for values that can be coerced to nodes.

members

coerce

(coerce _)

sexprs

(sexprs nodes)

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