Skip to main content

Crate leo_parser_rowan

Crate leo_parser_rowan 

Source
Expand description

Rowan-based lossless syntax tree and parser for Leo.

This crate provides a lossless parser using the rowan library, designed for IDE-grade error recovery. It will eventually replace the LALRPOP-based parser in leo-parser-lossless.

Structs§

LexError
An error encountered during lexing.
Parse
The result of a parse operation.
ParseError
An error encountered during parsing.
Parser
The parser state.
Token
A token produced by the lexer.

Enums§

LeoLanguage
The Leo language type for rowan.
SyntaxKind
All syntax kinds for Leo tokens and nodes.

Functions§

lex
Lex the given source text into a sequence of tokens.
parse_expression
Parse an expression from source code.
parse_expression_entry
Parse a single expression.
parse_file
Parse a complete Leo source file.
parse_main
Parse a main program file from source code.
parse_module
Parse a module from source code.
parse_module_entry
Parse module contents (const, struct, inline declarations only).
parse_statement
Parse a statement from source code.
parse_statement_entry
Parse a single statement.
syntax_kind_from_raw
Convert a raw rowan SyntaxKind to our SyntaxKind.

Type Aliases§

SyntaxElement
Either a syntax node or token.
SyntaxNode
A syntax node in the Leo syntax tree.
SyntaxToken
A syntax token in the Leo syntax tree.