From 518ce7b3adba950ae03bfa9e69980e66aa4da519 Mon Sep 17 00:00:00 2001 From: Goren Barak Date: Sat, 18 Nov 2023 08:27:30 -0500 Subject: [PATCH] Added Param object to Value enum --- src/parse/ast.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/parse/ast.rs b/src/parse/ast.rs index ac9dca8..59480c7 100644 --- a/src/parse/ast.rs +++ b/src/parse/ast.rs @@ -39,13 +39,13 @@ pub struct FunDefinition<'a> { name: &'a str, params: Vec>, contents: Vec>, - return_value: &'a Expr<'a>, + return_value: Value<'a>, } #[derive(Debug)] pub struct FunParamDef<'a> { name: &'a str, - number: u8, + number: u64, } #[derive(Debug)] @@ -66,15 +66,25 @@ pub struct VarReference<'a> { pub name: &'a str, } +#[derive(Debug, Copy, Clone)] +pub struct ParamReference<'a> { + pub param_number: u64, +} + #[derive(Debug, Copy, Clone)] pub enum Value<'a> { Var(VarReference<'a>), + Param(ParamReference<'a>), Number(u64), } impl<'a> Value<'a> { pub fn unwrap(&self) -> String { match self { + Value::Param(e) => { + + }, + Value::Number(e) => { return e.to_string(); },