Skip to content

Commit

Permalink
fix a bug in sided reach
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Jan 12, 2025
1 parent 47061fb commit 3688864
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/compile/modifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,11 @@ impl Compiler {
node = Node::Mod(Dip, eco_vec![SigNode::new(sn.sig, node)], span);
node.prepend(Node::Prim(Flip, span));
}
SubSide::Right => node.prepend(Node::Mod(
Dip,
eco_vec![SigNode::new((2, 2), Node::Prim(Flip, span))],
span,
)),
SubSide::Right => {
node.prepend(Node::Prim(Pop, span));
node = Node::Mod(Off, eco_vec![node.sig_node().unwrap()], span);
node.prepend(Node::Prim(Flip, span));
}
}
} else {
node.prepend(Node::Mod(
Expand Down
5 changes: 5 additions & 0 deletions tests/units.ua
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,11 @@ path(
⍤⤙≍ [1 2 3 6] [◠(++)] 1 2 3
⍤⤙≍ [1 2 ¯1 2] [◠(¯⊙∘)] 1 2

# Reach
⍤⤙≍ 4 𝄐+ 1 2 3
⍤⤙≍ {@b "acd"} {𝄐⌞⊟₃} @a@b@c@d
⍤⤙≍ {"acd" @b} {𝄐⌟⊟₃} @a@b@c@d

# Derivative
⍤⤙≍ 10 ∂(×.) 5
⍤⤙≍ 1.5 ∂√ 1/9
Expand Down

0 comments on commit 3688864

Please sign in to comment.