mirror of
https://github.com/Dummi26/mers.git
synced 2025-04-29 02:26:03 +02:00
27 lines
606 B
Rust
Executable File
27 lines
606 B
Rust
Executable File
use crate::parsing::SourcePos;
|
|
use crate::{data::Data, program};
|
|
|
|
use super::{CompInfo, MersStatement};
|
|
|
|
#[derive(Debug)]
|
|
pub struct Value {
|
|
pub pos_in_src: SourcePos,
|
|
pub data: Data,
|
|
}
|
|
|
|
impl MersStatement for Value {
|
|
fn has_scope(&self) -> bool {
|
|
false
|
|
}
|
|
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::value::Value {
|
|
pos_in_src: self.pos_in_src,
|
|
val: self.data.clone(),
|
|
}))
|
|
}
|
|
}
|