2024-02-29 02:04:38 +00:00
|
|
|
use crate::{
|
|
|
|
context::Context,
|
|
|
|
error::{RuntimeError, ValidationError},
|
|
|
|
Value,
|
|
|
|
};
|
2024-02-25 18:49:26 +00:00
|
|
|
|
2024-03-02 01:17:55 +00:00
|
|
|
use super::{AbstractTree, Statement, Type};
|
2024-02-25 18:49:26 +00:00
|
|
|
|
2024-02-25 19:26:22 +00:00
|
|
|
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)]
|
2024-02-26 21:27:01 +00:00
|
|
|
pub struct Loop<'src> {
|
2024-03-02 01:17:55 +00:00
|
|
|
statements: Vec<Statement<'src>>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'src> Loop<'src> {
|
|
|
|
pub fn new(statements: Vec<Statement<'src>>) -> Self {
|
|
|
|
Self { statements }
|
|
|
|
}
|
2024-02-25 18:49:26 +00:00
|
|
|
}
|
|
|
|
|
2024-02-26 21:27:01 +00:00
|
|
|
impl<'src> AbstractTree for Loop<'src> {
|
2024-02-29 02:04:38 +00:00
|
|
|
fn expected_type(&self, _context: &Context) -> Result<Type, ValidationError> {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn validate(&self, _context: &Context) -> Result<(), ValidationError> {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
2024-02-25 18:49:26 +00:00
|
|
|
fn run(self, _: &Context) -> Result<Value, RuntimeError> {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
}
|