Expand description
This module contains free-standing functions for creating AST fragments out of smaller pieces.
Note that all functions here intended to be stupid constructors, which just
assemble a finish node from immediate children. If you want to do something
smarter than that, it belongs to the ext
submodule.
Keep in mind that from_text
functions should be kept private. The public
API should require to assemble every node piecewise. The trick of
parse(format!())
we use internally is an implementation detail – long
term, it will be replaced with direct tree manipulation.
Modules§
- While the parent module defines basic atomic “constructors”, the
ext
module defines shortcuts for common things.
Functions§
- Ideally this function wouldn’t exist since it involves manual indenting. It differs from
make::block_expr
by also supporting comments and whitespace. - Returns a
BindPat
if the path has just one segment, aPathPat
otherwise. - Creates a tuple of patterns from an iterator of patterns.