Liking cljdoc? Tell your friends :D

rewrite-cljc.node

Create and evaluate nodes.

All nodes represent Clojure/ClojureScript/EDN.

Create and evaluate nodes.

All nodes represent Clojure/ClojureScript/EDN.
raw docstring

*elide-metadata*clj/s

The Clojure reader can add positional metadata. This metadata is not in the original source, and therefore assumed to be uninteresting to users of rewrite-cljc. Clojure will add :line and :column to quoted lists. Sci, and therefore Babashka does the same for all elements that accept metadata and adds :end-line and :end-column

The Clojure reader can add positional metadata.
This metadata is not in the original source, and therefore assumed to be uninteresting to users of rewrite-cljc.
Clojure will add `:line` and `:column` to quoted lists.
Sci, and therefore Babashka does the same for all elements that accept metadata and adds `:end-line` and `:end-column`
sourceraw docstring

child-sexprsclj/s

(child-sexprs node)

Returns children for node converted to forms.

Returns children for `node` converted to forms.
sourceraw docstring

childrenclj/s

(children node)

Returns child nodes for node.

Returns child nodes for `node`.
sourceraw docstring

coerceclj/s

(coerce form)

Coerce form to node.

Coerce `form` to node.
sourceraw docstring

comma-nodeclj/s

(comma-node s)

Create comma node of string s, where s is one or more comma characters.

Create comma node of string `s`, where `s` is one or more comma characters.
sourceraw docstring

comma-separatedclj/s

(comma-separated nodes)

Interleave nodes with ", " nodes.

Interleave `nodes` with `", "` nodes.
sourceraw docstring

comma?clj/s

(comma? node)

Returns true if node represents one or more commas.

Returns true if `node` represents one or more commas.
sourceraw docstring

comment-nodeclj/s

(comment-node s)

Create node representing a comment with text s.

Create node representing a comment with text `s`.
sourceraw docstring

comment?clj/s

(comment? node)

Returns true if node is a comment.

Returns true if `node` is a comment.
sourceraw docstring

deref-nodeclj/s

(deref-node children)

Create node representing the dereferencing of a form (i.e. @...) where children is either a sequence of nodes or a single node.

Create node representing the dereferencing of a form (i.e. `@...`)
where `children` is either a sequence of nodes or a single node.
sourceraw docstring

eval-nodeclj/s

(eval-node children)

Create node representing an inline evaluation (i.e. #=...) where children is either a sequence of nodes or a single node.

Create node representing an inline evaluation (i.e. `#=...`)
where `children` is either a sequence of nodes or a single node.
sourceraw docstring

fn-nodeclj/s

(fn-node children)

Create node representing an anonymous function with children.

Create node representing an anonymous function with `children`.
sourceraw docstring

form-metaclj/s

(form-meta form)

Same as clojure.core/meta but respects [[rewrite-cljc/elide-metadata]]. Use when you want to omit reader generated metadata on forms.

Same as `clojure.core/meta` but respects [[rewrite-cljc/*elide-metadata*]].
Use when you want to omit reader generated metadata on forms.
sourceraw docstring

forms-nodeclj/s

(forms-node children)

Create top-level node wrapping multiple children (equivalent to an implicit do at the top-level).

Create top-level node wrapping multiple `children`
(equivalent to an implicit `do` at the top-level).
sourceraw docstring

inner?clj/s

(inner? node)

Returns true if node can have children.

Returns true if `node` can have children.
sourceraw docstring

integer-nodeclj/s

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

Create node representing an integer value in base.

base defaults to 10.

Create node representing an integer `value` in `base`.

`base` defaults to 10.
sourceraw docstring

keyword-nodeclj/s

(keyword-node k & [namespaced?])

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

Create node representing a keyword `k`. If `namespaced?` is `true`
a keyword à la `::x` or `::ns/x` (i.e. namespaced/aliased/auto-resolved) is generated.
sourceraw docstring

leader-lengthclj/s

(leader-length node)

Returns number of characters before children for node.

Returns number of characters before children for `node`.
sourceraw docstring

lengthclj/s

(length node)

Return number of characters for the string version of node.

Return number of characters for the string version of `node`.
sourceraw docstring

line-separatedclj/s

(line-separated nodes)

Interleave nodes with newline nodes.

Interleave `nodes` with newline nodes.
sourceraw docstring

linebreak?clj/s

(linebreak? node)

Returns true if node represents one or more linebreaks.

Returns true if `node` represents one or more linebreaks.
sourceraw docstring

list-nodeclj/s

(list-node children)

Create a node representing a list with children.

Create a node representing a list with `children`.
sourceraw docstring

map-nodeclj/s

(map-node children)

Create a node representing an map with children.

Create a node representing an map with `children`.
sourceraw docstring

meta-nodeclj/s

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

Create node representing a form data and its metadata.

Create node representing a form `data` and its `metadata`.
sourceraw docstring

namespaced-map-nodeclj/s

(namespaced-map-node children)

Create a node representing a namespaced map. There are 3 types of namespaced maps:

  1. prefix namespaced map The prefix is a keyword which specifies to a namespace. Example: #:my.name.space{:a 1}

  2. auto-resolve alias namespaced map The prefix is an auto-resolve keyword specifies a namespace alias. Example: #::ns-alias{:b 3}

  3. auto-resolve namespaced map The prefix is :: which specifies the current namespace. Example: #::{:c 4}

First child is the prefix, followed by optional whitespace then map node. TODO: this still seems hacky to me. Prefix must be a token-node with a keyword value. Use (keyword ':') for auto-resolve.

Create a node representing a namespaced map. There are 3 types of namespaced maps:

 1. prefix namespaced map
 The prefix is a keyword which specifies to a namespace.
 Example: `#:my.name.space{:a 1}`

 2. auto-resolve alias namespaced map
 The prefix is an auto-resolve keyword specifies a namespace alias.
 Example: `#::ns-alias{:b 3}`

 3. auto-resolve namespaced map
 The prefix is `::` which specifies the current namespace.
 Example: `#::{:c 4}`

First child is the prefix, followed by optional whitespace then map node.
TODO: this still seems hacky to me.
Prefix must be a token-node with a keyword value. Use (keyword ':') for auto-resolve.
sourceraw docstring

newline-nodeclj/s

(newline-node s)

Create newline node of string s, where s is one or more linebreak characters.

Create newline node of string `s`, where `s` is one or more linebreak characters.
sourceraw docstring

newlinesclj/s

(newlines n)

Create node representing n newline characters.

Create node representing `n` newline characters.
sourceraw docstring

node?clj/s

(node? x)

Returns true if x is a rewrite-cljc created node.

Returns true if `x` is a rewrite-cljc created node.
sourceraw docstring

printable-only?clj/s

(printable-only? node)

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

Return true if `node` cannot be converted to an s-expression element.
sourceraw docstring

quote-nodeclj/s

(quote-node children)

Create node representing a quoted form where children is either a sequence of nodes or a single node.

Create node representing a quoted form where `children`
is either a sequence of nodes or a single node.
sourceraw docstring

raw-meta-nodeclj/s

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

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

Create node representing a form `data` and its `metadata` using the
`#^` prefix.
sourceraw docstring

reader-macro-nodeclj/s

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

Create node representing a reader macro (i.e. #... ...) with children.

Create node representing a reader macro (i.e. `#... ...`) with `children`. 
sourceraw docstring

regex-nodeclj/s

(regex-node pattern-string)

Create node representing a regex with pattern-string

Create node representing a regex with `pattern-string`
sourceraw docstring

replace-childrenclj/s

(replace-children node children)

Returns node replacing current children with children.

Returns `node` replacing current children with `children`.
sourceraw docstring

set-nodeclj/s

(set-node children)

Create a node representing a set with children.

Create a node representing a set with `children`.
sourceraw docstring

sexprclj/s

(sexpr node)

Return node converted to form.

Return `node` converted to form.
sourceraw docstring

sexprsclj/s

(sexprs nodes)

Return forms for nodes. Nodes that do not represent s-expression are skipped.

Return forms for `nodes`. Nodes that do not represent s-expression are skipped.
sourceraw docstring

spacesclj/s

(spaces n)

Create node representing n spaces.

Create node representing `n` spaces.
sourceraw docstring

stringclj/s

(string node)

Return the string version of node.

Return the string version of `node`.
sourceraw docstring

string-nodeclj/s

(string-node lines)

Create node representing a string value where lines can be a sequence of strings or a single string.

Create node representing a string value where `lines`
can be a sequence of strings or a single string.
sourceraw docstring

syntax-quote-nodeclj/s

(syntax-quote-node children)

Create node representing a syntax-quoted form where children is either a sequence of nodes or a single node.

Create node representing a syntax-quoted form where `children`
is either a sequence of nodes or a single node.
sourceraw docstring

tagclj/s

(tag node)

Returns keyword representing type of node.

Returns keyword representing type of `node`.
sourceraw docstring

token-nodeclj/s

(token-node value)
(token-node value string-value)

Create node for an unspecified token of value.

Create node for an unspecified token of `value`.
sourceraw docstring

uneval-nodeclj/s

(uneval-node children)

Create node representing an uneval #_ form with children.

Create node representing an uneval `#_` form with `children`.
sourceraw docstring

unquote-nodeclj/s

(unquote-node children)

Create node representing an unquoted form (i.e. ~...) where children. is either a sequence of nodes or a single node.

Create node representing an unquoted form (i.e. `~...`) where `children`.
is either a sequence of nodes or a single node.
sourceraw docstring

unquote-splicing-nodeclj/s

(unquote-splicing-node children)

Create node representing an unquote-spliced form (i.e. ~@...) where children. is either a sequence of nodes or a single node.

Create node representing an unquote-spliced form (i.e. `~@...`) where `children`.
is either a sequence of nodes or a single node.
sourceraw docstring

valueclj/sdeprecated

(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)

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) 
sourceraw docstring

var-nodeclj/s

(var-node children)

Create node representing a var where children is either a sequence of nodes or a single node.

Create node representing a var
where `children` is either a sequence of nodes or a single node.
sourceraw docstring

vector-nodeclj/s

(vector-node children)

Create a node representing a vector with children.

Create a node representing a vector with `children`.
sourceraw docstring

whitespace-nodeclj/s

(whitespace-node s)

Create whitespace node of string s, where s is one or more space characters.

Create whitespace node of string `s`, where `s` is one or more space characters.
sourceraw docstring

whitespace-nodesclj/s

(whitespace-nodes s)

Convert string s of whitespace to whitespace/newline nodes.

Convert string `s` of whitespace to whitespace/newline nodes.
sourceraw docstring

whitespace-or-comment?clj/s

(whitespace-or-comment? node)

Return true when node represents whitespace or comment.

Return true when `node` represents whitespace or comment.
sourceraw docstring

whitespace?clj/s

(whitespace? node)

Returns true if node represents Clojure whitespace.

Returns true if `node` represents Clojure whitespace.
sourceraw docstring

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

× close