Functions for working with the Meander's match compiler intermediate representation (IR).
Functions for working with the Meander's match compiler intermediate representation (IR).
(branch? node)
true if node has any children, false otherwise.
true if node has any children, false otherwise.
(breadth-first?)
true
if the current IR compilation environment *env*
specifies
a :search-order
of :breadth-first
.
`true` if the current IR compilation environment `*env*` specifies a `:search-order` of `:breadth-first`.
(children node)
Return the child nodes of node, a sequence of ::node.
Return the child nodes of node, a sequence of ::node.
(do-merge a b then)
(do-merge a b then else)
Attempts to merge two nodes a
and b
into a new node. If the
merge is successful the function then
is invoked with the new
node. If the merge fails and the optional function else
was
passed, then else
is invoked with a
and b
. If the merge fails
and else
was not passed, then the value ::merge-fail
is
returned.
Attempts to merge two nodes `a` and `b` into a new node. If the merge is successful the function `then` is invoked with the new node. If the merge fails and the optional function `else` was passed, then `else` is invoked with `a` and `b`. If the merge fails and `else` was not passed, then the value `::merge-fail` is returned.
(fail-form kind)
Returns (list FAIL) if kind is :search,
FAIL otherwise. This is
used when compiling :def nodes to ensure the correct type of data is
returned to code compiled for :call nodes.
Returns `(list FAIL) if kind is :search, `FAIL otherwise. This is used when compiling :def nodes to ensure the correct type of data is returned to code compiled for :call nodes.
(js-array-equals-form a b)
Form used to test if two arrays a and b are equal in ClojureScript.
Form used to test if two arrays a and b are equal in ClojureScript.
(merge a b)
Attempt to merge the nodes a
and b
. Returns the result of the merge
if the merge succeeds. Returns a :branch
node with :arms
[a b]
if the merge fails.
Attempt to merge the nodes `a` and `b`. Returns the result of the merge if the merge succeeds. Returns a `:branch` node with `:arms` `[a b]` if the merge fails.
(merge* node-a node-b)
Attempts to merge two nodes into one node returning node* if successful and ::merge-fail otherwise.
Attempts to merge two nodes into one node returning node* if successful and ::merge-fail otherwise.
(merge-all nodes)
Attempts to successively merge all nodes in nodes
from left to
right.
Attempts to successively merge all nodes in `nodes` from left to right.
(node? x)
true if x is a ::node, false otherwise.
true if x is a ::node, false otherwise.
(nodes node)
Return all subnodes of node, a sequence of ::node.
Return all subnodes of node, a sequence of ::node.
(op-fail? x)
true
if x
is an :fail node, false
otherwise.
`true` if `x` is an :fail node, `false` otherwise.
(op-pass? x)
true
if x
is an :pass node, false
otherwise.
`true` if `x` is an :pass node, `false` otherwise.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close