diff --git a/src/ast/mod.rs b/src/ast/mod.rs index e568a8f..06398f0 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -236,42 +236,33 @@ pub struct ModuleShapeDef { ret: Box, } -macro_rules! value_enum { - ($doc:meta $i:tt, $t:ty, $l:ty, $($extra:tt)*) => { - #[$doc] - #[derive(PartialEq, Debug, Clone)] - pub enum $i { - // Simple Values - Empty(Position), - Boolean(PositionedItem), - Int(PositionedItem), - Float(PositionedItem), - Str(PositionedItem), - Symbol(PositionedItem), - // Complex Values - Tuple(PositionedItem<$t>), - List($l), - // Extra items - $( $extra )* - } - } +#[doc = "Value types represent the Values that UCG can have."] +#[derive(PartialEq, Debug, Clone)] +pub enum Value { + Empty(Position), + Boolean(PositionedItem), + Int(PositionedItem), + Float(PositionedItem), + Str(PositionedItem), + Symbol(PositionedItem), + Tuple(PositionedItem), + List(ListDef), } -value_enum!( - doc="Value types represent the Values that UCG can have." - Value, - FieldList, - ListDef, -); - -value_enum!( - doc="Shapes represent the types that UCG values or expressions can have." - Shape, - ShapeTuple, - PositionedItem, +#[doc = "Shapes represent the types that UCG values or expressions can have."] +#[derive(PartialEq, Debug, Clone)] +pub enum Shape { + Empty(Position), + Boolean(PositionedItem), + Int(PositionedItem), + Float(PositionedItem), + Str(PositionedItem), + Symbol(PositionedItem), + Tuple(PositionedItem), + List(PositionedItem), Func(FuncShapeDef), Module(ModuleShapeDef), -); +} impl Shape { pub fn merge(&self, right: &Shape) -> Option {