diff --git a/compiler/cl-interpret/src/interpret.rs b/compiler/cl-interpret/src/interpret.rs index fcfad53..79650bc 100644 --- a/compiler/cl-interpret/src/interpret.rs +++ b/compiler/cl-interpret/src/interpret.rs @@ -47,14 +47,20 @@ impl Interpret for Alias { } } impl Interpret for Const { - fn interpret(&self, _env: &mut Environment) -> IResult { - println!("TODO: {self}"); + fn interpret(&self, env: &mut Environment) -> IResult { + let Const { name, ty: _, init } = self; + + let init = init.as_ref().interpret(env)?; + env.insert(*name, Some(init)); Ok(ConValue::Empty) } } impl Interpret for Static { - fn interpret(&self, _env: &mut Environment) -> IResult { - println!("TODO: {self}"); + fn interpret(&self, env: &mut Environment) -> IResult { + let Static { mutable: _, name, ty: _, init } = self; + + let init = init.as_ref().interpret(env)?; + env.insert(*name, Some(init)); Ok(ConValue::Empty) } }