Crate rust_sitter
source ·Modules
Structs
An error that occurred in
Parser::set_included_ranges.A summary of a change to a text document.
An opaque object that defines how to parse a particular language. The code for each
Language is generated by the Tree-sitter CLI.An error that occurred when trying to assign an incompatible
Language to a Parser.A single node within a syntax
Tree.A stateful object that this is used to produce a
Tree based on some source code.A position in a multi-line text document, in terms of rows and columns.
A set of patterns that match nodes in a syntax tree.
A particular
Node that has been captured with a particular name within a Query.A sequence of
QueryCaptures associated with a given QueryCursor.A stateful object for executing a
Query on a syntax Tree.An error that occurred when trying to create a
Query.A match of a
Query to a particular set of Nodes.A sequence of
QueryMatches associated with a given QueryCursor.A key-value pair associated with a particular pattern in a
Query.A key-value pair associated with a particular pattern in a
Query.A range of positions in a multi-line text document, both in terms of bytes and of
rows and columns.
A wrapper around a value that also contains the span of the value in the source.
A tree that represents the syntactic structure of a source code file.
A stateful object for walking a syntax
Tree efficiently.Enums
A quantifier for captures
A type of log message.
Constants
The latest ABI version that is supported by the current version of the
library.
The earliest ABI version that is supported by the current version of the
library.
Traits
Defines the logic used to convert a node in a Tree Sitter tree to
the corresponding Rust type.
Functions
Attribute Macros
On
Vec<_> typed fields, specifies a non-terminal that should be parsed in between the elements.
The [rust_sitter::repeat] annotation must be used on the field as well.Mark a module to be analyzed for a Rust Sitter grammar. Takes a single, unnamed argument, which
specifies the name of the grammar. This name must be unique across all Rust Sitter grammars within
a compilation unit.
Marks the top level AST node where parsing should start.
Defines a field which matches a specific token in the source string.
The token can be defined by passing one of two arguments
Defines a precedence level for a non-terminal that should be left-associative.
For example, with subtraction we expect 1 - 2 - 3 to be parsed as (1 - 2) - 3,
which corresponds to a left-associativity.
On
Vec<_> typed fields, specifies additional config for how the repeated elements should
be parsed. In particular, this annotation takes the following named arguments:Defines a field that does not correspond to anything in the input string,
such as some metadata. Takes a single, unnamed argument, which is the value
used to populate the field at runtime.