LiveData.Tracked.FlatAst.Util (live_data v0.1.0-alpha0)
Link to this section Summary
Functions
Given an expression, will return a list of all subexpressions.
Given an arbitrarily nested list data structure, will flatten it into a single list.
Expression traversal/update primitive.
Traverses the AST starting at id
.
Traverses the AST starting at id
.
Link to this section Functions
child_exprs(expr)
Given an expression, will return a list of all subexpressions.
recursive_flatten(val)
Given an arbitrarily nested list data structure, will flatten it into a single list.
reduce_expr(expr, acc, fun)
transform_expr(expr, acc, fun)
Expression traversal/update primitive.
Given an expression, an accululator and a function, will apply the function over all subexpressions of the expression.
The accumulator will be woven through, and will be returned alongside the updated expression.
traverse(ast, id, expr \\ nil, acc, fun)
Traverses the AST starting at id
.
User provided function will be called on a node before its children.
traverse_post(ast, id, expr \\ nil, acc, fun)
Traverses the AST starting at id
.
User provided function will be called on a node after its children.