[][src]Crate mun_syntax

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;

Modules

ast

Macros

T
token_set

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:

SourceFile
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 the text, represented as a pair of TextUnits.

TextUnit

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.

Token

A token of Mun source

Enums

Direction
SyntaxErrorKind
SyntaxKind

The kind of syntax node, e.g. IDENT, USE_KW, or STRUCT_DEF.

Functions

tokenize

Break a string up into its component tokens

Type Definitions

SyntaxElement
SyntaxNode
SyntaxToken