Skip to content

Commit c97fd3d

Browse files
committed
fix a bug in name resolution
1 parent cd034cd commit c97fd3d

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

src/compile/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1753,14 +1753,14 @@ impl Compiler {
17531753
if prefer_module {
17541754
only_modules.reverse();
17551755
}
1756-
'outer: for only_modules in only_modules {
1756+
for only_modules in only_modules {
17571757
let mut hit_stop = false;
17581758
for scope in self.scopes() {
17591759
if matches!(scope.kind, ScopeKind::File(_))
17601760
|| stop_at_binding && matches!(scope.kind, ScopeKind::Binding)
17611761
{
17621762
if hit_stop {
1763-
break 'outer;
1763+
break;
17641764
}
17651765
hit_stop = true;
17661766
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ mod tests {
252252
let code = std::fs::read_to_string(&path).unwrap();
253253
// Test running
254254
let mut env = Uiua::with_native_sys();
255-
let mut comp = Compiler::new();
255+
let mut comp = Compiler::with_backend(NativeSys);
256256
if let Err(e) = comp
257257
.load_str_src(&code, &path)
258258
.and_then(|comp| env.run_asm(comp.asm.clone()))

tests/data_defs.ua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,7 @@ M! ← F!^
158158
⍤⤙≍ {2 1 5} °⊸Run~A 2 Run~New 5
159159
⍤⤙≍ [0 8 5] Run!°⊸B8 5
160160
⍤⤙≍ [2 8 5] Run!(°⊸A2 °⊸B8) 5
161+
162+
┌─╴M
163+
X ← 21 M!()
164+
└─╴

tests/units.ua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,3 +783,6 @@ path(
783783
⍤⤙≍ "bcade" ⊂∪⌞⊟⊟₃ @a@b@c@d@e
784784
⍤⤙≍ "aebcd" ⊂∪⌟⊟⊟₃ @a@b@c@d@e
785785
⍤⤙≍ {3_4 1_2_5} ∪₂⌞{⊟|⊟₃} 1 2 3 4 5
786+
787+
~ "data_defs" ~ M
788+
⍤⤙≍ 21 M~X

0 commit comments

Comments
 (0)