mirror of
https://github.com/MorizzG/MLox.git
synced 2025-12-06 04:22:41 +00:00
27 lines
297 B
Lox
27 lines
297 B
Lox
|
|
var f;
|
||
|
|
var g;
|
||
|
|
|
||
|
|
{
|
||
|
|
var local = "local";
|
||
|
|
fun f_() {
|
||
|
|
print local;
|
||
|
|
local = "after f";
|
||
|
|
print local;
|
||
|
|
}
|
||
|
|
f = f_;
|
||
|
|
|
||
|
|
fun g_() {
|
||
|
|
print local;
|
||
|
|
local = "after g";
|
||
|
|
print local;
|
||
|
|
}
|
||
|
|
g = g_;
|
||
|
|
}
|
||
|
|
|
||
|
|
f();
|
||
|
|
// expect: local
|
||
|
|
// expect: after f
|
||
|
|
|
||
|
|
g();
|
||
|
|
// expect: after f
|
||
|
|
// expect: after g
|