wip
This commit is contained in:
parent
6e02a1a644
commit
463e4abd30
13 changed files with 172 additions and 26 deletions
14
lox/nested_while.lox
Normal file
14
lox/nested_while.lox
Normal 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
8
lox/scope.lox
Normal file
|
@ -0,0 +1,8 @@
|
|||
var a = "outer";
|
||||
|
||||
{
|
||||
var a = "inner";
|
||||
print a; // expect: inner
|
||||
}
|
||||
|
||||
print a;
|
3
lox/simple_for.lox
Normal file
3
lox/simple_for.lox
Normal file
|
@ -0,0 +1,3 @@
|
|||
for (var i = 0; i < 10; i = i + 1) {
|
||||
print i;
|
||||
}
|
5
lox/simple_while.lox
Normal file
5
lox/simple_while.lox
Normal file
|
@ -0,0 +1,5 @@
|
|||
var i = 0;
|
||||
while (i < 10) {
|
||||
print i;
|
||||
i = i + 1;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue