Skip to main content

active_core/
ast.rs

1//! Concrete Syntax Tree (placeholder for future expansion)
2//! The dual-syntax round-trip (C-022) is implemented without a CST: the IR
3//! carries source spans for every node plus comment trivia with normative
4//! attachments, which is enough to re-emit either canonical style. The
5//! parser builds the IR directly.
6//! The alpha parser currently builds the IR directly.
7
8#![allow(dead_code)]
9
10#[derive(Debug, Clone)]
11pub struct Document {
12    pub statements: Vec<Statement>,
13}
14
15#[derive(Debug, Clone)]
16pub enum Statement {
17    Let { name: String, expr: Expr },
18    Table { name: String, body: Vec<Statement> },
19    KeyValue { key: String, value: Expr },
20}
21
22#[derive(Debug, Clone)]
23pub enum Expr {
24    Null,
25    Bool(bool),
26    Int(i64),
27    String(String),
28    Ident(String),
29    Env {
30        name: String,
31        default: Option<Box<Expr>>,
32    },
33    Array(Vec<Expr>),
34    Table(Vec<(String, Expr)>),
35}