diff options
Diffstat (limited to 'compiler/src/ast/mod.rs')
| -rw-r--r-- | compiler/src/ast/mod.rs | 27 |
1 files changed, 27 insertions, 0 deletions
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 @@ | |||
| 1 | mod error; | ||
| 2 | mod parser; | ||
| 3 | |||
| 4 | use std::rc::Rc; | ||
| 5 | |||
| 6 | use crate::span::Spanned; | ||
| 7 | pub use error::Error; | ||
| 8 | pub use parser::Parser; | ||
| 9 | |||
| 10 | #[derive(Clone, Debug)] | ||
| 11 | pub enum Atom { | ||
| 12 | Float(f64), | ||
| 13 | Integer(i64), | ||
| 14 | String(Rc<str>), | ||
| 15 | Symbol(Rc<str>), | ||
| 16 | Bool(bool), | ||
| 17 | Nil, | ||
| 18 | } | ||
| 19 | |||
| 20 | #[derive(Clone, Debug)] | ||
| 21 | pub enum Expr { | ||
| 22 | Atom(Atom), | ||
| 23 | List(Vec<Spanned<Expr>>), | ||
| 24 | } | ||
| 25 | |||
| 26 | #[derive(Clone, Debug)] | ||
| 27 | pub struct Program(pub Vec<Spanned<Expr>>); | ||
