use super::super::HighLevelEmitter;
mod chain;
mod guards;
mod parse;
mod scan;
#[cfg(test)]
mod tests;
impl HighLevelEmitter {
pub(crate) fn rewrite_switch_statements(statements: &mut Vec<String>) {
let mut index = 0usize;
while index < statements.len() {
if let Some((replacement, end)) =
guards::try_build_guarded_goto_switch(statements, index)
{
statements.splice(index..=end, replacement);
index += 1;
continue;
}
if let Some((replacement, end)) = chain::try_build_switch(statements, index) {
statements.splice(index..=end, replacement);
index += 1;
continue;
}
index += 1;
}
}
}