use crate::lower::ir;
use microcad_lang_base::SrcRef;
use microcad_lang_proc_macros::SrcReferrer;
#[derive(Clone, Debug, Default, PartialEq, SrcReferrer)]
pub struct TupleExpression {
pub args: ir::ArgumentList,
pub src_ref: SrcRef,
}
impl std::fmt::Display for TupleExpression {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
write!(
f,
"({})",
self.args
.iter()
.map(|arg| if let Some(name) = &arg.id {
format!("{} = {}", &name, arg.expression)
} else {
arg.to_string()
})
.collect::<Vec<String>>()
.join(", ")
)?;
Ok(())
}
}