Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mook: re-enable stack traces for %mean hints #273

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 21 additions & 14 deletions rust/sword/src/jets/nock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,20 +248,27 @@ pub mod util {
let tape = rip(stack, 3, 1, atom)?;
T(stack, &[LEAF, tape])
}
Right(_cell) => {
// 'tank: {
// let scry = null_scry(context);
// if let Ok(tone) = mink(context, dat, cell.head(), scry) {
// if let Some(cell) = tone.cell() {
// if cell.head().raw_equals(D(0)) {
// // XX: need to check that this is
// // actually a path;
// // return leaf+"mook.mean" if not
// break 'tank cell.tail();
// }
// }
// }
{
Right(cell) => {
'tank: {
let scry = null_scry(&mut context.stack);
// if +mink didn't crash...
if let Ok(tone) = mink(context, dat, cell.head(), scry) {
if let Some(tonc) = tone.cell() {
// ...and +mink didn't fail or block...
if tonc.head().raw_equals(D(0)) {
// ...return $tank from $tone
// XX: need to check that this is
// actually a tank;
// return leaf+"mook.mean" if not
break 'tank tonc.tail();
}
} else {
panic!("+mink in +mook somehow returned atom {}", tone)
}
}

// This code only called when the break statement
// above doesn't trigger
let stack = &mut context.stack;
let tape = tape(stack, "####");
T(stack, &[LEAF, tape])
Expand Down