use microcad_lang_base::{Identifier, SrcRef};
use microcad_lang_proc_macros::SrcReferrer;
use crate::{ty::*, value::*};
#[derive(Clone, Debug, SrcReferrer)]
pub struct ArgumentValue {
pub value: Value,
pub inline_id: Option<Identifier>,
src_ref: SrcRef,
}
impl std::fmt::Display for ArgumentValue {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{val}", val = self.value,)
}
}
impl Ty for ArgumentValue {
fn ty(&self) -> Type {
self.value.ty()
}
}
impl ArgumentValue {
pub fn new(value: Value, inline_id: Option<Identifier>, src_ref: SrcRef) -> Self {
Self {
value,
inline_id,
src_ref,
}
}
}