dsl_parse/parsed_file.rs
1//! Top-level result type returned by [`parse`](crate::parse).
2
3use crate::ast::Statement;
4use crate::error::ParseError;
5use serde::Serialize;
6
7/// A whole SQL file, sliced into top-level statements.
8///
9/// `statements.len() == split_statements(source).len()`. Failed statements
10/// are present as `StatementKind::Unknown` so callers can render the
11/// surrounding statements normally; the matching `ParseError` lives in
12/// [`errors`](ParsedFile::errors).
13#[derive(Debug, Clone, Serialize)]
14pub struct ParsedFile {
15 pub statements: Vec<Statement>,
16 pub errors: Vec<ParseError>,
17}