jets: +rep:by fix, and link to +rep:in too

This commit is contained in:
Matthew LeVan 2024-06-14 22:07:15 -04:00
parent a18f94a8d3
commit 1734fb1c0d
2 changed files with 13 additions and 7 deletions

View File

@ -229,6 +229,11 @@ pub const URBIT_HOT_STATE: &[HotEntry] = &[
1,
jet_by_rep,
),
(
&[K_139, Left(b"one"), Left(b"two"), Left(b"in"), Left(b"rep")],
1,
jet_by_rep, // +rep:in has the same signature as +rep:by
),
//
(
&[

View File

@ -9,16 +9,17 @@ crate::gdb!();
fn by_rep(context: &mut Context, tree: Noun, site: &Site, out: &mut Noun) {
if unsafe { tree.raw_equals(D(0)) } {
} else {
let node = slot(tree, 2).unwrap();
let left = slot(node, 6).unwrap();
let rite = slot(node, 7).unwrap();
} else if let Ok(node) = slot(tree, 2) {
let acc = T(&mut context.stack, &[node, *out]);
*out = site_slam(context, site, acc);
by_rep(context, left, site, out);
by_rep(context, rite, site, out);
if let Ok(left) = slot(tree, 6) {
by_rep(context, left, site, out);
}
if let Ok(rite) = slot(tree, 7) {
by_rep(context, rite, site, out);
}
}
}