Expand description
Unified syntax tree types.
This module defines the core tree data structures shared by all docstring
styles. Every parsed docstring is represented as a tree of SyntaxNodes
(branches) and SyntaxTokens (leaves), each tagged with a SyntaxKind.
The Parsed struct owns the source text and the root node, and provides
a convenience pretty_print method for debugging.
Structs§
- Parsed
- The result of parsing a docstring.
- Syntax
Node - A branch node in the syntax tree.
- Syntax
Token - A leaf token in the syntax tree.
Enums§
- Syntax
Element - A child element of a
SyntaxNode— either a node or a token. - Syntax
Kind - Node and token kinds for all docstring styles.
Traits§
- Visitor
- Trait for visiting syntax tree nodes and tokens.
Functions§
- walk
- Walk the syntax tree depth-first, calling the visitor methods.