mirror of
https://github.com/Dummi26/mers.git
synced 2025-04-28 18:16:05 +02:00
24 lines
519 B
Rust
Executable File
24 lines
519 B
Rust
Executable File
use crate::program;
|
|
|
|
use super::{CompInfo, MersStatement};
|
|
|
|
#[derive(Debug)]
|
|
pub struct Loop {
|
|
pub inner: Box<dyn MersStatement>,
|
|
}
|
|
|
|
impl MersStatement for Loop {
|
|
fn has_scope(&self) -> bool {
|
|
true
|
|
}
|
|
fn compile_custom(
|
|
&self,
|
|
info: &mut crate::info::Info<super::Local>,
|
|
comp: CompInfo,
|
|
) -> Result<Box<dyn program::run::MersStatement>, String> {
|
|
Ok(Box::new(program::run::r#loop::Loop {
|
|
inner: self.inner.compile(info, comp)?,
|
|
}))
|
|
}
|
|
}
|