diff --git a/src/protocol/parser/pass_tokenizer.rs b/src/protocol/parser/pass_tokenizer.rs index d6f457a90a4963c90a0f36bb011df94335f6e695..d41b6f65939a7267f7a38fb635d78b51fb634e1d 100644 --- a/src/protocol/parser/pass_tokenizer.rs +++ b/src/protocol/parser/pass_tokenizer.rs @@ -786,77 +786,3 @@ fn maybe_number_remaining(c: u8) -> bool { (c >= b'0' && c <= b'9') || (c >= b'A' && c <= b'F') || (c >= b'a' && c <= b'f') || c == b'_'; } - -#[cfg(test)] -mod tests { - use super::*; - - // TODO: Remove at some point - #[test] - fn test_tokenizer() { - let mut source = InputSource::new_test(" - - #version 500 - # hello 2 - - import std.reo::*; - - struct Thing { - int a: 5, - } - enum Hello { - A, - B - } - - // Hello hello, is it me you are looking for? - // I can seee it in your eeeyes - - func something(int a, int b, int c) -> byte { - int a = 5; - struct Inner { - int a - } - struct City { - int b - } - /* Waza - How are you doing - Things in here yo - /* */ */ - - a = a + 5 * 2; - struct Pressure { - int d - } - } - "); - let mut t = PassTokenizer::new(); - let mut buffer = TokenBuffer::new(); - t.tokenize(&mut source, &mut buffer).expect("tokenize"); - - println!("Ranges:\n"); - for (idx, range) in buffer.ranges.iter().enumerate() { - println!("[{}] {:?}", idx, range) - } - - println!("Tokens:\n"); - let mut iter = buffer.tokens.iter().enumerate(); - while let Some((idx, token)) = iter.next() { - match token.kind { - TokenKind::Ident | TokenKind::Pragma | TokenKind::Integer | - TokenKind::String | TokenKind::Character | TokenKind::LineComment | - TokenKind::BlockComment => { - let (_, end) = iter.next().unwrap(); - println!("[{}] {:?} ......", idx, token.kind); - assert_eq!(end.kind, TokenKind::SpanEnd); - let text = source.section_at_pos(token.pos, end.pos); - println!("{}", String::from_utf8_lossy(text)); - }, - _ => { - println!("[{}] {:?}", idx, token.kind); - } - } - } - } -} \ No newline at end of file diff --git a/src/runtime/connector.rs b/src/runtime/connector.rs index 70f9df50e1b80d8f0245a4e99e2c50114a5062e3..e9bce7685c94520e6df7cf873184512aee407e1f 100644 --- a/src/runtime/connector.rs +++ b/src/runtime/connector.rs @@ -245,7 +245,6 @@ impl ConnectorPDL { } pub fn handle_new_sync_comp_message(&mut self, message: SyncCompMessage, ctx: &mut ComponentCtx) -> Option { - println!("DEBUG: Actually really handling {:?}", message); if let Some(round_conclusion) = self.consensus.handle_new_sync_comp_message(message, ctx) { return Some(self.enter_non_sync_mode(round_conclusion, ctx)); } @@ -412,9 +411,7 @@ impl ConnectorPDL { self.eval_error = Some(eval_error); self.mode = Mode::SyncError; - println!("DEBUGERINO: Notify of fatal branch"); if let Some(conclusion) = self.consensus.notify_of_fatal_branch(branch_id, comp_ctx) { - println!("DEBUGERINO: Actually got {:?}", conclusion); return self.enter_non_sync_mode(conclusion, comp_ctx); } } diff --git a/src/runtime/consensus.rs b/src/runtime/consensus.rs index af043c10367dba4b228e5d5eb460ee29180a62c2..1147f447ef8a25ef9a8b8e0754c36b4527efdfc0 100644 --- a/src/runtime/consensus.rs +++ b/src/runtime/consensus.rs @@ -172,7 +172,6 @@ impl Consensus { // the consensus algorithm let branch = &self.branch_annotations[failed_branch_id.index as usize]; if branch.channel_mapping.iter().all(|v| v.registered_id.is_none()) { - println!("DEBUG: Failure everything silent"); return Some(RoundConclusion::Failure); } @@ -302,7 +301,6 @@ impl Consensus { let _branch = &self.branch_annotations[branch_id.index as usize]; // Clear out internal storage to defaults - println!("DEBUG: ***** Incrementing sync round stuff"); self.highest_connector_id = ConnectorId::new_invalid(); self.branch_annotations.clear(); self.branch_markers.clear(); @@ -319,8 +317,6 @@ impl Consensus { peer.encountered_this_round = false; peer.expected_sync_round += 1; } - - println!("DEBUG: ***** Peers post round are:\n{:#?}", &self.peers) } // --- Handling messages @@ -432,7 +428,6 @@ impl Consensus { }, SyncCompContent::GlobalFailure => { // Global failure of round, send Ack to leader - println!("DEBUGERINO: Got GlobalFailure, sending Ack in response"); debug_assert_ne!(self.highest_connector_id, ctx.id); // not the leader let _result = self.send_to_leader_or_handle_as_leader(SyncCompContent::AckFailure, ctx); debug_assert!(_result.is_none()); @@ -591,7 +586,6 @@ impl Consensus { fn handle_received_sync_header(&mut self, sync_header: SyncHeader, ctx: &mut ComponentCtx) -> MessageOrigin { debug_assert!(sync_header.sending_component_id != ctx.id); // not sending to ourselves let origin = self.handle_peer(&sync_header); - println!(" ********************** GOT {:?}", origin); if origin != MessageOrigin::Present { // We do not have to handle it now return origin; @@ -809,7 +803,6 @@ impl Consensus { } } - println!("DEBUGERINO: Leader entering error state, we need to wait on {:?}", encountered.iter().map(|v| v.index).collect::>()); self.conclusion = Some(RoundConclusion::Failure); if encountered.is_empty() { // We don't have to wait on Acks @@ -845,7 +838,6 @@ impl Consensus { let maybe_conclusion = self.send_to_leader_or_handle_as_leader(SyncCompContent::LocalFailure, ctx); debug_assert!(if maybe_already.is_some() { maybe_conclusion.is_some() } else { true }); - println!("DEBUG: Maybe conclusion is {:?}", maybe_conclusion); // Initiate a discovery wave so peers can do the same self.handled_wave = true; @@ -1225,8 +1217,6 @@ impl SolutionCombiner { } } - println!("DEBUGGERINO Presence is now:\n{:#?}", self.presence); - return self.check_for_global_failure(); } @@ -1473,11 +1463,9 @@ impl SolutionCombiner { } // Handle channel presence - println!("DEBUGERINO: Presence before joining is {:#?}", &self.presence); if self.presence.is_empty() { // Trivial case self.presence = combiner.presence; - println!("DEBUGERINO: Trivial merging") } else { for presence in combiner.presence { match self.presence.iter_mut().find(|v| v.id == presence.id) { @@ -1509,11 +1497,9 @@ impl SolutionCombiner { } } } - println!("DEBUGERINO: Presence after joining is {:#?}", &self.presence); // After adding everything we might have immediately found a solution if self.check_for_global_failure() { - println!("DEBUG: Returning immediate failure?"); return Some(LeaderConclusion::Failure); } } diff --git a/src/runtime/mod.rs b/src/runtime/mod.rs index 58df7c21a5e9985f55c09a7988f0e6649b6ebd6a..2ff16486774492e9c9cb88948d50266620a77446 100644 --- a/src/runtime/mod.rs +++ b/src/runtime/mod.rs @@ -592,7 +592,6 @@ impl ConnectorStore { } } - println!("DEBUG [ global store ] Created component at {}", key.index); return key; } @@ -606,7 +605,6 @@ impl ConnectorStore { // Note: but not deallocating! } - println!("DEBUG [ global store ] Destroyed component at {}", key.index); self.free.push(key.index as usize); } } diff --git a/src/runtime/scheduler.rs b/src/runtime/scheduler.rs index a30ab63ff58a13b9d8625e587c077980fc289fcb..bab05fc9a171dd65bee3c1216149a2f73e299cf8 100644 --- a/src/runtime/scheduler.rs +++ b/src/runtime/scheduler.rs @@ -411,11 +411,11 @@ impl Scheduler { } fn debug(&self, message: &str) { - println!("DEBUG [thrd:{:02} conn: ]: {}", self.scheduler_id, message); + // println!("DEBUG [thrd:{:02} conn: ]: {}", self.scheduler_id, message); } fn debug_conn(&self, conn: ConnectorId, message: &str) { - println!("DEBUG [thrd:{:02} conn:{:02}]: {}", self.scheduler_id, conn.index, message); + // println!("DEBUG [thrd:{:02} conn:{:02}]: {}", self.scheduler_id, conn.index, message); } } @@ -543,7 +543,6 @@ impl ComponentCtx { }; if !is_valid { // We don't own the port - println!(" ****** DEBUG ****** : Sending through closed port!!! {}", port_id.index); return Err(()); } }