Skip to main content

Crate sql_dialect_fmt_parser

Crate sql_dialect_fmt_parser 

Source
Expand description

Error-resilient, event-based recursive-descent parser for Snowflake SQL.

parse turns source text into a lossless rowan CST plus a list of ParseErrors. Parsing never fails: malformed input is wrapped in ERROR nodes and recovery continues, so the tree always round-trips byte-for-byte (the basis for formatting and highlighting).

§Pipeline

tokenize → [input::Input] → [parser::Parser] (emits events) → [builder::build_tree].

§Modules

  • event / input / parser / grammar / builder — the parsing pipeline.
  • ast — typed accessors over the untyped tree.

Structs§

FromClause
Parse
The result of parsing: a lossless green tree plus any diagnostics.
ParseError
A diagnostic produced while parsing, located at a byte span into the source.
SelectItem
SelectList
SelectStmt
SourceFile
WhereClause

Enums§

Dialect
The SQL dialect a lex/parse/format request targets.
SyntaxKind
Every lexical token kind and syntax node kind understood by sql-dialect-fmt.

Traits§

AstNode
A typed view of a CST node of a particular kind.

Functions§

parse
Parse Snowflake SQL source into a lossless CST. Never panics; never loses input.
parse_with_dialect
Parse text as dialect into a lossless CST. Never panics; never loses input.

Type Aliases§

SyntaxNode