Crate biome_rowan

Crate biome_rowan 

Source
Expand description

A generic library for lossless syntax trees. See examples/s_expressions.rs for a tutorial.

Re-exports§

pub use crate::syntax::chain_trivia_pieces;
pub use crate::syntax::trim_leading_trivia_pieces;
pub use crate::syntax::trim_trailing_trivia_pieces;
pub use crate::syntax::ChainTriviaPiecesIterator;
pub use crate::syntax::Language;
pub use crate::syntax::SendNode;
pub use crate::syntax::SyntaxElement;
pub use crate::syntax::SyntaxElementChildren;
pub use crate::syntax::SyntaxKind;
pub use crate::syntax::SyntaxList;
pub use crate::syntax::SyntaxNode;
pub use crate::syntax::SyntaxNodeChildren;
pub use crate::syntax::SyntaxNodeOptionExt;
pub use crate::syntax::SyntaxRewriter;
pub use crate::syntax::SyntaxSlot;
pub use crate::syntax::SyntaxSlots;
pub use crate::syntax::SyntaxToken;
pub use crate::syntax::SyntaxTriviaPiece;
pub use crate::syntax::SyntaxTriviaPieceComments;
pub use crate::syntax::TriviaPiece;
pub use crate::syntax::TriviaPieceKind;
pub use crate::syntax::VisitNodeSignal;

Modules§

cursor
Implementation of the cursors – API for convenient access to syntax trees.
raw_language
Provides a sample language implementation that is useful in API explanation or tests
support
syntax

Macros§

declare_node_union
Declares a custom union AstNode type with an ungram-like syntax
match_ast
Matches a SyntaxNode against an ast type.

Structs§

AstNodeListIterator
AstSeparatedElement
AstSeparatedListElementsIterator
AstSeparatedListNodesIterator
AstSeparatorIterator
BatchMutation
Checkpoint
A checkpoint for maybe wrapping a node. See GreenNodeBuilder::checkpoint for details.
NodeCache
Interner for GreenTokens and GreenNodes
ParsedChildren
The parsed children of a node, not accounting for any missing children (required or optional)
ParsedChildrenIntoIterator
ParsedChildrenIterator
RawNodeSlots
Description of the slots of a node in combination with ParsedChildren. It stores for each slot if the node is present in ParsedChildren or not, allowing to generate a node with the right number of empty slots.
RawSyntaxKind
RawSyntaxKind is a type tag for each token or node.
RawSyntaxNode
New-type wrapper around a GreenNode.
RawSyntaxNodeRef
New-type wrapper to a reference of a GreenNode.
RawSyntaxToken
New-type wrapper around a GreenToken. Allows third-party crates to access limited information on not yet fully constructed nodes.
RawSyntaxTokenRef
New-type wrapper to a reference of a GreenToken
SyntaxKindSet
Represents a set of SyntaxKind as a bitfield, with each bit representing whether the corresponding RawSyntaxKind value is contained in the set
SyntaxNodeText
TextRange
A range in text, represented as a pair of TextSize.
TextSize
A measure of text length. Also, equivalently, an index into text.
TokenText
Reference to the text of a SyntaxToken without having to worry about the lifetime of &str.
TreeBuilder
A builder for a syntax tree.

Enums§

Direction
FileSourceError
Errors around the construct of the source type
NodeOrToken
SyntaxError
TokenAtOffset
There might be zero, one or two leaves at a given offset.
WalkEvent
WalkEvent describes tree walking process.

Traits§

AstNode
The main trait to go from untyped SyntaxNode to a typed ast. The conversion itself has zero runtime cost: ast and syntax nodes have exactly the same representation: a pointer to the tree root and a pointer to the node itself.
AstNodeExt
AstNodeList
List of homogenous nodes
AstNodeListExt
AstNodeSlotMap
An AstNode that supports dynamic ordering of the fields it contains uses a slot_map to map the declared order of fields to the concrete order as parsed from the source content. Implementing this trait lets consumers
AstSeparatedList
List of nodes where every two nodes are separated by a token. For example, the elements of an array where every two elements are separated by a comma token. The list expects that the underlying syntax node has a slot for every node and separator even if they are missing from the source code. For example, a list for a b where the , separator is missing contains the slots Node(a), Empty, Node(b). This also applies for missing nodes: the list for , b, must have the slots Empty, Token(,), Node(b), Token(,).
AstSeparatedListExt
BatchMutationExt
SyntaxFactory
Factory for creating syntax nodes of a particular kind.
SyntaxNodeCast
TextLen
Primitives with a textual length that can be passed to TextSize::of.

Functions§

check_live

Type Aliases§

RawSyntaxElement
RawSyntaxElementRef
SyntaxResult
Specific result used when navigating nodes using AST APIs