2024-02-26 21:27:01 +00:00
|
|
|
use crate::{context::Context, error::RuntimeError, Value};
|
2024-02-25 18:49:26 +00:00
|
|
|
|
2024-02-26 21:27:01 +00:00
|
|
|
use super::{AbstractTree, Statement};
|
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 Block<'src> {
|
|
|
|
statements: Vec<Statement<'src>>,
|
2024-02-25 18:49:26 +00:00
|
|
|
}
|
|
|
|
|
2024-02-26 21:27:01 +00:00
|
|
|
impl<'src> Block<'src> {
|
|
|
|
pub fn new(statements: Vec<Statement<'src>>) -> Self {
|
2024-02-25 18:49:26 +00:00
|
|
|
Self { statements }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-26 21:27:01 +00:00
|
|
|
impl<'src> AbstractTree for Block<'src> {
|
2024-02-25 18:49:26 +00:00
|
|
|
fn run(self, _: &Context) -> Result<Value, RuntimeError> {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
}
|