[msl-out] implement composing arrays and structs

This commit is contained in:
Dzmitry Malyshau 2021-03-16 22:30:35 -04:00 committed by Dzmitry Malyshau
parent 9846a85174
commit e715bda507

View File

@ -280,6 +280,16 @@ impl<W: Write> Writer<W> {
)?;
self.put_call_parameters(components.iter().cloned(), context)?;
}
crate::TypeInner::Array { .. } | crate::TypeInner::Struct { .. } => {
write!(self.out, "{} {{", &self.names[&NameKey::Type(ty)])?;
for (i, &component) in components.iter().enumerate() {
if i != 0 {
write!(self.out, ", ")?;
}
self.put_expression(component, context)?;
}
write!(self.out, "}}")?;
}
_ => return Err(Error::UnsupportedCompose(ty)),
}
}