Skip to content

Commit 6cc846a

Browse files
committed
Add basic test for lexical scope inference
This simply checks that a scoped block got created at PC index 7 (which will enclose a variable scope, but this is harder to spot with a regex) where previously the variable would have been global.
1 parent 5e2f632 commit 6cc846a

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed
418 Bytes
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
test.class
3+
--show-symbol-table
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^pc7:
7+
--
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
public class test {
2+
3+
public static void main() {
4+
5+
int x = 5;
6+
if(x == 4) {
7+
int y = x + 1;
8+
++y;
9+
}
10+
else {
11+
int z = x + 1;
12+
++z;
13+
}
14+
15+
}
16+
17+
}

0 commit comments

Comments
 (0)