pub struct ParsedStatement<'a>(/* private fields */);Expand description
Parse result for one successfully recognized SQLite statement.
Contains statement-local data:
- Typed AST root (
root()). - Optional token stream (
tokens()). - Optional comments (
comments()). - Original source slice (
source()).
Implementations§
Source§impl<'a> ParsedStatement<'a>
impl<'a> ParsedStatement<'a>
Sourcepub fn root(&'a self) -> Option<Stmt<'a>>
pub fn root(&'a self) -> Option<Stmt<'a>>
Typed AST root for the statement.
Returns None for comment-only input (valid SQL with no actual
statement, e.g. /* no-op */).
Mirrors C syntaqlite_result_root for PARSE_OK.
Sourcepub fn tokens(&self) -> impl Iterator<Item = ParserToken<'a>>
pub fn tokens(&self) -> impl Iterator<Item = ParserToken<'a>>
Statement-local token stream with parser usage flags.
Requires collect_tokens: true in ParserConfig.
Sourcepub fn comments(&self) -> impl Iterator<Item = Comment<'a>>
pub fn comments(&self) -> impl Iterator<Item = Comment<'a>>
Comments that belong to this statement.
Requires collect_tokens: true in ParserConfig.
Sourcepub fn erase(&self) -> AnyParsedStatement<'a>
pub fn erase(&self) -> AnyParsedStatement<'a>
Convert this result into the grammar-agnostic AnyParsedStatement.
Use this when handing statement data to grammar-independent tooling.
Sourcepub fn macro_regions(&self) -> impl Iterator<Item = MacroRegion> + use<'_, 'a>
pub fn macro_regions(&self) -> impl Iterator<Item = MacroRegion> + use<'_, 'a>
Macro expansion call-site spans recorded during parsing.