diff --git a/src/protocol/mod.rs b/src/protocol/mod.rs index c3deda22f0cfdfe0559ccda1054ada090fc6ae46..97986eb6333fd7cc9a11578f68d3aa8fac07799d 100644 --- a/src/protocol/mod.rs +++ b/src/protocol/mod.rs @@ -47,26 +47,26 @@ impl ProtocolDescription for ProtocolDescriptionImpl { } } } - fn main_interface_polarities(&self) -> Vec { - let def = &self.heap[self.main]; - let mut result = Vec::new(); - for ¶m in def.parameters().iter() { - let param = &self.heap[param]; - let type_annot = &self.heap[param.type_annotation]; - let ptype = &type_annot.the_type.primitive; - if ptype == &PrimitiveType::Input { - result.push(Polarity::Getter) - } else if ptype == &PrimitiveType::Output { - result.push(Polarity::Putter) - } else { - unreachable!() - } - } - result - } - fn new_main_component(&self, interface: &[Key]) -> ComponentStateImpl { + // fn main_interface_polarities(&self) -> Vec { + // let def = &self.heap[self.main]; + // let mut result = Vec::new(); + // for ¶m in def.parameters().iter() { + // let param = &self.heap[param]; + // let type_annot = &self.heap[param.type_annotation]; + // let ptype = &type_annot.the_type.primitive; + // if ptype == &PrimitiveType::Input { + // result.push(Polarity::Getter) + // } else if ptype == &PrimitiveType::Output { + // result.push(Polarity::Putter) + // } else { + // unreachable!() + // } + // } + // result + // } + fn new_main_component(&self, ports: &[Key]) -> ComponentStateImpl { let mut args = Vec::new(); - for (&x, y) in interface.iter().zip(self.main_interface_polarities()) { + for (&x, y) in ports.iter().zip(self.main_interface_polarities()) { match y { Polarity::Getter => args.push(Value::Input(InputValue(x))), Polarity::Putter => args.push(Value::Output(OutputValue(x))),