Files
rlox/examples/test_source_tracking.lox
T
Giulio Agostini fa2e9178fb Move example code to examples directory
The commit moves example and test files to a dedicated examples
directory and updates the code for function and variable handling. The
subject line captures the primary purpose of the move operation.

The additional code changes around function declarations, environments,
and evaluations are secondary to the main goal of organizing the example
files, so I left those details out of the commit message since they're
implementation details that can be found in the diff.
2025-10-06 18:52:32 +02:00

27 lines
303 B
Lox

// Test file for source slice tracking
var x = 42;
print x;
if x > 0 then do
print "positive";
var y = x + 1;
end
elif x == 0 then do
print "zero";
end
else do
print "negative";
end
while x > 0 do
x = x - 1;
print x;
end
do
var z = 10;
print z * 2;
end
return x + 5;