Crate rowan

source ·
Expand description

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

Structs

GreenNode is an immutable syntax tree, which is cheap to update. It lacks parent pointers and information about offsets.
A builder for a green tree.
TreeRoot for owned flavor of SyntaxNode.
TreeRoot for borrowed flavor of SyntaxNode.
A SmolStr is a string type that has the following properties:
An immutable lazy constructed syntax tree with offsets and parent pointers.
Iterator over node’s children.
A range in the text, represented as a pair of TextUnits.
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.

Enums

There might be zero, one or two leaves at a given offset.
WalkeEvent describes tree walking process.

Traits

A marker trait to distinguish between owned and borrowed trees. You don’t need to implement it yourself, use existing OwnedRoot or RefRoot.
Types customizes data, stored in the syntax tree. All types in this crate are parametrized over T: Types.