This commit is contained in:
Sebastian Hugentobler 2025-05-28 09:05:18 +02:00
parent 6e02a1a644
commit 463e4abd30
Signed by: shu
SSH key fingerprint: SHA256:ppcx6MlixdNZd5EUM1nkHOKoyQYoJwzuQKXM6J/t66M
13 changed files with 172 additions and 26 deletions

14
lox/nested_while.lox Normal file
View file

@ -0,0 +1,14 @@
{
var i = 0;
var j = 0;
while (i < 10) {
print i;
while (j < 100) {
print j;
j = j + 1;
}
i = i + 1;
}
}

8
lox/scope.lox Normal file
View file

@ -0,0 +1,8 @@
var a = "outer";
{
var a = "inner";
print a; // expect: inner
}
print a;

3
lox/simple_for.lox Normal file
View file

@ -0,0 +1,3 @@
for (var i = 0; i < 10; i = i + 1) {
print i;
}

5
lox/simple_while.lox Normal file
View file

@ -0,0 +1,5 @@
var i = 0;
while (i < 10) {
print i;
i = i + 1;
}