Skip to main content

clean

Function clean 

Source
pub fn clean<L: Lang + ?Sized>(lang: &L, val: Vec<Node>) -> Node
Expand description

Python’s clean: fold the tree down to a single (text, num) leaf.

Mirrors the original’s quirk where the tail val[2:] is appended as a nested list rather than spliced, which changes how the next iteration sees it.