mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-05 08:10:05 +00:00
CPunch
a408353c25
a LoopState was added to the CCompilerState struct which keeps track of breaks, start chunk index, and the start scope of the active loop. Also, break.cosmo was added to the examples directory, 'continue' and 'break' work as expected.
26 lines
515 B
Plaintext
26 lines
515 B
Plaintext
// just testing continues and breaks
|
|
|
|
for (var x = 0; x < 700; x++) do
|
|
for (var i = 0; true; i++) do
|
|
var str = i .. "." .. x
|
|
if (i == 998) then
|
|
print(i .. " reached")
|
|
break
|
|
end
|
|
|
|
print("for cont- " .. str)
|
|
continue
|
|
end
|
|
|
|
var i = 0
|
|
while true do
|
|
var str = i .. "." .. x
|
|
if (i++ == 1034) then
|
|
print("done")
|
|
break
|
|
end
|
|
|
|
print("while cont- " .. str)
|
|
continue
|
|
end
|
|
end |