Expand description
parse_tree
is a library to represent so-called parse tree.
A parse tree is a non-abstract AST: it’s a generic syntax tree
which remembers all whitespace, comments and other trivia.
Modules§
Structs§
- Bottom
UpBuilder - A builder for creating parse trees by a bottom-up walk over the tree nodes.
- Parse
Tree - The parse tree for a single source file.
- PtNode
- PtNode
Id - Symbol
- A type of a syntactic construct, including both leaf tokens and composite nodes, like “a comma” or “a function”.
- Text
Range - A range in the text, represented as a pair of
TextUnit
s. - Text
Unit - An offset into text.
Offset is represented as
u32
storing number of utf8-bytes, but most of the clients should treat it like opaque measure. - Token
- A token of source code.
- TopDown
Builder - A builder for creating parse trees by a top-down walk over
the tree nodes. Each
start_internal
call must be paired with afinish_internal
call. Nodes created within a pair ofstart_internal
/finish_internal
calls become children of the internal node.