(defn children
"Return a vector of the children expression of the AST node, if it has any.
The children expressions are kept in order and flattened so that the returning
vector contains only nodes and not vectors of nodes."
[ast]
(persistent!
(reduce (fn [acc [_ c]] ((if (vector? c) into! conj!) acc c))
(transient []) (children* ast))))