Crate mun_syntax

Source
Expand description

Syntax Tree Library used throughout Mun.

This crate is heavily inspired by Rust Analyzers ra_syntax and ra_parser crates.

Properties: - easy and fast incremental re-parsing - graceful handling of errors - full-fidelity representation (any text can be precisely represented as a syntax tree)

Re-exports§

pub use crate::ast::AstNode;
pub use crate::ast::AstToken;
pub use crate::ast::SourceFile;

Modules§

ast
utils

Macros§

T
match_ast
Matches a SyntaxNode against an ast type.

Structs§

AstPtr
Like SyntaxNodePtr, but remembers the type of node
Parse
Parse is the result of the parsing: a syntax tree and a collection of errors.
SmolStr
A SmolStr is a string type that has the following properties:
SyntaxError
SyntaxNodePtr
A pointer to a syntax node inside a file. It can be used to remember a specific node across reparses of the same file.
SyntaxTreeBuilder
TextRange
A range in text, represented as a pair of TextSize.
TextSize
A measure of text length. Also, equivalently, an index into text.
Token
A token of Mun source
TokenText

Enums§

Direction
Location
SyntaxErrorKind
SyntaxKind
The kind of syntax node, e.g. IDENT, USE_KW, or STRUCT_DEF.
WalkEvent
WalkEvent describes tree walking process.

Functions§

tokenize
Break a string up into its component tokens

Type Aliases§

SyntaxElement
SyntaxNode
SyntaxToken