diff --git a/src/protocol/mod.rs b/src/protocol/mod.rs index bdf9a9cb2b715ca4b6dc13ab5267ff845deac23b..1f2b33ede745d27fc1336470d05211b5532a8ccf 100644 --- a/src/protocol/mod.rs +++ b/src/protocol/mod.rs @@ -61,10 +61,7 @@ impl std::fmt::Debug for ProtocolDescription { } } impl ProtocolDescription { - // TODO: Allow for multi-file compilation pub fn parse(buffer: &[u8]) -> Result { - // TODO: @fixme, keep code compilable, but needs support for multiple - // input files. let source = InputSource::new(String::new(), Vec::from(buffer)); let mut parser = Parser::new(); parser.feed(source).expect("failed to feed source"); @@ -158,7 +155,7 @@ impl ProtocolDescription { let module_root = self.lookup_module_root(module_name).unwrap(); let root = &self.heap[module_root]; let def = root.get_definition_ident(&self.heap, identifier).unwrap(); - // TODO: Check for polymorph + ComponentState { prompt: Prompt::new(&self.types, &self.heap, def, 0, ValueGroup::new_stack(args)) } } @@ -291,7 +288,6 @@ impl ProtocolDescription { } } -// TODO: @temp Should just become a concrete thing that is passed in pub trait RunContext { fn performed_put(&mut self, port: PortId) -> bool; fn performed_get(&mut self, port: PortId) -> Option; // None if still waiting on message @@ -325,12 +321,10 @@ impl ComponentState { let step_result = self.prompt.step(&pd.types, &pd.heap, &pd.modules, ctx); match step_result { Err(reason) => { - // TODO: @temp println!("Evaluation error:\n{}", reason); todo!("proper error handling/bubbling up"); }, Ok(continuation) => match continuation { - // TODO: Probably want to remove this translation EC::Stepping => continue, EC::BranchInconsistent => return RR::BranchInconsistent, EC::ComponentTerminated => return RR::ComponentTerminated, @@ -376,7 +370,7 @@ impl ComponentState { // Not possible to end sync block if never entered one EvalContinuation::SyncBlockEnd => unreachable!(), EvalContinuation::NewComponent(definition_id, monomorph_idx, args) => { - // Look up definition (TODO for now, assume it is a definition) + // Look up definition let mut moved_ports = HashSet::new(); for arg in args.values.iter() { match arg { @@ -549,13 +543,6 @@ impl RunContext for EvalContext<'_> { // TODO: @remove once old runtime has disappeared impl EvalContext<'_> { - // fn random(&mut self) -> LongValue { - // match self { - // // EvalContext::None => unreachable!(), - // EvalContext::Nonsync(_context) => todo!(), - // EvalContext::Sync(_) => unreachable!(), - // } - // } fn new_component(&mut self, moved_ports: HashSet, init_state: ComponentState) -> () { match self { EvalContext::None => unreachable!(),