Skip to content

Commit

Permalink
add under get
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Dec 22, 2023
1 parent c04cb73 commit ce59f97
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 24 deletions.
13 changes: 13 additions & 0 deletions src/algorithm/invert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,19 @@ pub(crate) fn under_instrs(
&stash2!(Select, Unselect),
&(Val, stash2!(Pick, Unpick)),
&stash2!(Pick, Unpick),
&(
Val,
pat!(
Get,
(CopyToTempN(2), Get),
(PopTempN(1), Flip, PopTempN(1), Insert),
),
),
&pat!(
Get,
(CopyToTempN(2), Get),
(PopTempN(1), Flip, PopTempN(1), Insert),
),
&(
Val,
pat!(
Expand Down
48 changes: 24 additions & 24 deletions src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,30 +391,30 @@ code:
break;
};
// Uncomment to debug
// for val in &self.rt.stack {
// print!("{:?} ", val);
// }
// println!();
// if !self.rt.array_stack.is_empty() {
// print!("array: ");
// for val in &self.rt.array_stack {
// print!("{:?} ", val);
// }
// println!();
// }
// if !self.rt.function_stack.is_empty() {
// println!("{} function(s)", self.rt.function_stack.len());
// }
// for temp in enum_iterator::all::<TempStack>() {
// if !self.rt.temp_stacks[temp as usize].is_empty() {
// print!("{temp}: ");
// for val in &self.rt.temp_stacks[temp as usize] {
// print!("{:?} ", val);
// }
// println!();
// }
// }
// println!(" {:?}", instr);
for val in &self.rt.stack {
print!("{:?} ", val);
}
println!();
if !self.rt.array_stack.is_empty() {
print!("array: ");
for val in &self.rt.array_stack {
print!("{:?} ", val);
}
println!();
}
if !self.rt.function_stack.is_empty() {
println!("{} function(s)", self.rt.function_stack.len());
}
for temp in enum_iterator::all::<TempStack>() {
if !self.rt.temp_stacks[temp as usize].is_empty() {
print!("{temp}: ");
for val in &self.rt.temp_stacks[temp as usize] {
print!("{:?} ", val);
}
println!();
}
}
println!(" {:?}", instr);

if self.rt.time_instrs {
formatted_instr = format!("{instr:?}");
Expand Down

0 comments on commit ce59f97

Please sign in to comment.