Skip to content

Commit 1f0d5c7

Browse files
committed
fix: update formatting for lox files
1 parent dd5576c commit 1f0d5c7

File tree

19 files changed

+29
-31
lines changed

19 files changed

+29
-31
lines changed

test_programs/r1/1.lox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ fun foo() {
99

1010
foo(); // expect: outer
1111
var a = "inner";
12-
foo(); // expect: inner
12+
foo(); // expect: inner

test_programs/r1/2.lox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ f();
1313
fun global() {
1414
print "local";
1515
}
16-
f();
16+
f();

test_programs/r2/2.lox

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ var counter = 0;
55

66
for (var i = 0; i < 3; i = i + 1) {
77
counter = counter + 1;
8-
8+
99
if (counter == 2) {
1010
var special = "special";
1111
print special;
1212
} else {
1313
print counter;
1414
}
15-
15+
1616
var i = "shadowed";
1717
print i;
1818
}

test_programs/r3/4.lox

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ print getA(); // expect: global
1717
print getA(); // expect: global
1818
setA("changed");
1919
print getA(); // expect: changed
20-
20+
2121
var a = "local";
2222
print a; // expect: local
2323
print getA(); // expect: changed
24-
24+
2525
fun localGetA() {
2626
return a;
2727
}
28-
28+
2929
print localGetA(); // expect: local
3030
a = "local modified";
3131
print localGetA(); // expect: local modified

test_programs/r4/1.lox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ expected_error_type: none
33
---
44
var a = "value";
55
var a = a; // global scope, so this is allowed
6-
print a; // expect: value
6+
print a; // expect: value

test_programs/r4/3.lox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ var b = "global";
1515

1616
// Reassigning with self-reference is fine for globals
1717
var b = b + " updated";
18-
print b;
18+
print b;

test_programs/r4/4.lox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ fun outer() {
1212
inner();
1313
}
1414

15-
outer();
15+
outer();

test_programs/r5/1.lox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ fun foo() {
55
return "at function scope is ok";
66
}
77

8-
return; // Error: Can't return from top-level code.
8+
return; // Error: Can't return from top-level code.

test_programs/r5/2.lox

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fun foo() {
66
// Return inside nested blocks in a function is fine
77
return "early return";
88
}
9-
9+
1010
for (var i = 0; i < 10; i = i + 1) {
1111
// Return inside loops in a function is fine too
1212
return "loop return";
@@ -16,4 +16,4 @@ fun foo() {
1616
// But this is still an error
1717
if (true) {
1818
return "conditional return"; // Error: Can't return from top-level code.
19-
}
19+
}

test_programs/r5/3.lox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ fun allowed() {
1010
return "this is fine"; // This is ok
1111
}
1212
return; // This is also ok
13-
}
13+
}

0 commit comments

Comments
 (0)