From bf4632c461508de5202db98d25cd7ec06787c8dd Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Sat, 26 Jul 2025 10:52:03 +0300 Subject: Created necessary data structures and utilities for integers and their operations; added tests for them --- src/sexp/mod.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/sexp/mod.rs (limited to 'src/sexp/mod.rs') diff --git a/src/sexp/mod.rs b/src/sexp/mod.rs new file mode 100644 index 0000000..c920e41 --- /dev/null +++ b/src/sexp/mod.rs @@ -0,0 +1,27 @@ + +pub mod step; +pub mod util; + +/// A leaf node for S-Expressions. +/// +/// May represent built-in operators, +/// variables (to be added), functions +/// (to be added) or values. +#[derive(Debug)] +#[derive(PartialEq)] +pub enum SLeaf { + Add, + Sub, + Mul, + Div, + Int(i32), +} + +/// An S-Expression; the defining structure of the language. +#[derive(Debug)] +#[derive(PartialEq)] +pub enum SExp { + SCons(Box, Box), + Atom(SLeaf), +} + -- cgit v1.2.3