Skip to content

Commit

Permalink
fix a bug with nested custom modifiers
Browse files Browse the repository at this point in the history
closes #271
  • Loading branch information
kaikalii committed Nov 30, 2023
1 parent 04196d5 commit ea648ab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Uiua is not yet stable.
<!-- This version is not yet released.
If you are reading this on the website, then these changes are live here. -->

## 0.4.1 - 2023-11-30
# Interpreter
- Fix a bug with nested custom modifiers

## 0.4.0 - 2023-11-30
### Language
- [`windows` ``](https://uiua.org/docs/windows) can now take negative window sizes
Expand Down
4 changes: 3 additions & 1 deletion src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,9 @@ impl Uiua {
Signature::new(0, 1),
)));
}
Global::Func { f, sig_declared } if call && !sig_declared => {
Global::Func { f, sig_declared }
if call && !sig_declared && count_temp_functions(&f.instrs) == 0 =>
{
self.extend_instrs(f.instrs.clone())
}
Global::Func { f, .. } => {
Expand Down
4 changes: 4 additions & 0 deletions tests/units.ua
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ ParseOrZero ← ⍣parse⋅⋅0

⍤⊃⋅∘≍ [⊙(+⊙(-⊙×)) 1 2 3 4 5] [⊙(+|-|×) 1 2 3 4 5]

F! ← ^1 5
G! ← F!^1
⍤⊃⋅∘≍ ¯5 G!¯

# Experimental!
⍤⊃⋅∘≍ 120 ↬((|1 ×↫-1.|1)<2.) 5
⍤⊃⋅∘≍ 8 ↬((+∩(|2 ↫ -)1,2|1)<2.) 5

0 comments on commit ea648ab

Please sign in to comment.