Expand description
Various helper functions to work with SyntaxNodes.
Functions§
- block_
as_ lone_ tail - eq_
label_ lt - expr_
as_ name_ ref - for_
each_ break_ and_ continue_ expr - for_
each_ tail_ expr - 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. - full_
path_ of_ name_ ref - is_
closure_ or_ blk_ with_ modif - is_
pattern_ cond - macro_
call_ for_ string_ token - parse_
tt_ as_ comma_ sep_ paths - Parses the input token tree as comma separated plain paths.
- preorder_
expr - 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. - preorder_
expr_ with_ ctx_ checker - single_
let - 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
). - vis_eq
- walk_
expr - Preorder walk all the expression’s child expressions.
- walk_
pat - Preorder walk all the pattern’s sub patterns.
- walk_
patterns_ in_ expr - Preorder walk all the expression’s child patterns.
- walk_ty
- Preorder walk all the type’s sub types.