1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//! Nautilus Schema Parser and Validator
//!
//! This crate provides end-to-end processing of `.nautilus` schema files.
//!
//! # Pipeline
//!
//! Processing a schema runs in four stages:
//! - **Lexer** — converts source text into typed tokens with span tracking.
//! - **Parser** — builds a syntax [`ast::Schema`] via recursive descent.
//! - **Validator** — performs multi-pass semantic validation and emits a fully
//! resolved [`ir::SchemaIr`].
//! - **Formatter** — renders an AST back to canonical source text.
//!
//! # Quick Start
//!
//! The [`analyze`] function runs the full pipeline in one call and collects all
//! diagnostics:
//!
//! ```ignore
//! use nautilus_schema::analyze;
//!
//! let result = analyze(source);
//! for diag in &result.diagnostics {
//! eprintln!("{:?} — {}", diag.severity, diag.message);
//! }
//! if let Some(ir) = &result.ir {
//! println!("{} models validated", ir.models.len());
//! }
//! ```
//!
//! # Visitor Pattern
//!
//! The [`visitor`] module provides a trait-based visitor for flexible AST traversal:
//!
//! ```ignore
//! use nautilus_schema::{visitor::{Visitor, walk_model}, ast::*, Result};
//!
//! struct ModelCounter { count: usize }
//!
//! impl Visitor for ModelCounter {
//! fn visit_model(&mut self, model: &ModelDecl) -> Result<()> {
//! self.count += 1;
//! walk_model(self, model)
//! }
//! }
//! ```
pub use ;
pub use ComputedKind;
pub use ;
pub use ;
pub use format_schema;
pub use Lexer;
pub use Parser;
pub use ;
pub use ;
pub use validate_schema;
/// Resolve `env(VAR_NAME)` syntax in a connection URL.
///
/// If `raw` matches the pattern `env(...)`, the value of the named
/// environment variable is returned. Otherwise `raw` is returned as-is.