From f6983686a66c3b8941af471d78642b307eb26f8e Mon Sep 17 00:00:00 2001 From: Tolmachev Igor Date: Sat, 9 May 2026 00:34:22 +0300 Subject: Add AST parser skeleton --- compiler/src/ast/mod.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 compiler/src/ast/mod.rs (limited to 'compiler/src/ast/mod.rs') diff --git a/compiler/src/ast/mod.rs b/compiler/src/ast/mod.rs new file mode 100644 index 0000000..4587ea7 --- /dev/null +++ b/compiler/src/ast/mod.rs @@ -0,0 +1,27 @@ +mod error; +mod parser; + +use std::rc::Rc; + +use crate::span::Spanned; +pub use error::Error; +pub use parser::Parser; + +#[derive(Clone, Debug)] +pub enum Atom { + Float(f64), + Integer(i64), + String(Rc), + Symbol(Rc), + Bool(bool), + Nil, +} + +#[derive(Clone, Debug)] +pub enum Expr { + Atom(Atom), + List(Vec>), +} + +#[derive(Clone, Debug)] +pub struct Program(pub Vec>); -- cgit v1.3