Skip to main content

eval-node

function

rewrite-clj.node/eval-node

(eval-node [children])
Create node representing an inline evaluation where `children` is either a sequence of nodes or a single node. ```Clojure (require '[rewrite-clj.node :as n]) (-> (n/eval-node (n/list-node [(n/token-node 'inc) (n/spaces 1) (n/token-node 1)])) n/string) ;; => "#=(inc 1)" ;; specifying a sequence allows for whitespace between the ;; prefix and the form (-> (n/eval-node [(n/spaces 3) (n/list-node [(n/token-node 'inc) (n/spaces 1) (n/token-node 1)])]) n/string) ;; => "#= (inc 1)" ```

No examples yet. Be the first to add one!