Expand description
Various helper functions to work with SyntaxNodes.
Functions§
- Calls
cb
on each expression insideexpr
that is at “tail position”. Does not walk intobreak
orreturn
expressions. Note that modifying the tree while iterating it will cause undefined iteration which might potentially results in an out of bounds panic. - Parses the input token tree as comma separated plain paths.
- Preorder walk all the expression’s child expressions preserving events. If the callback returns true on an [
WalkEvent::Enter
], the subtree of the expression will be skipped. Note that the subtree may already be skipped due to the context analysis this function does. - Returns the
let
only if there is exactly one (that is,let pat = expr
or((let pat = expr))
, but notlet pat = expr && expr
ornon_let_expr
). - Preorder walk all the expression’s child expressions.
- Preorder walk all the pattern’s sub patterns.
- Preorder walk all the expression’s child patterns.
- Preorder walk all the type’s sub types.