This commit is contained in:
Oleg Sobolev 2025-12-30 06:53:05 +03:00
parent 6f4a835e54
commit ef7dc3603d
5 changed files with 50 additions and 2 deletions

9
examples/fibonacci.lox Normal file
View file

@ -0,0 +1,9 @@
var a = 0;
var temp;
for (var b = 1; a < 10000; b = temp + b) {
print a;
temp = a;
a = b;
}

19
examples/scope.lox Normal file
View file

@ -0,0 +1,19 @@
var a = "global a";
var b = "global b";
var c = "global c";
{
var a = "outer a";
var b = "outer b";
{
var a = "inner a";
print a;
print b;
print c;
}
print a;
print b;
print c;
}
print a;
print b;
print c;