microcad_lang/eval/call/
argument_value.rs1use microcad_lang_base::{Identifier, SrcRef};
7use microcad_lang_proc_macros::SrcReferrer;
8
9use crate::{ty::*, value::*};
10
11#[derive(Clone, Debug, SrcReferrer)]
13pub struct ArgumentValue {
14 pub value: Value,
16 pub inline_id: Option<Identifier>,
18 src_ref: SrcRef,
20}
21
22impl std::fmt::Display for ArgumentValue {
23 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24 write!(f, "{val}", val = self.value,)
25 }
26}
27
28impl Ty for ArgumentValue {
29 fn ty(&self) -> Type {
30 self.value.ty()
31 }
32}
33
34impl ArgumentValue {
35 pub fn new(value: Value, inline_id: Option<Identifier>, src_ref: SrcRef) -> Self {
37 Self {
38 value,
39 inline_id,
40 src_ref,
41 }
42 }
43}