if (x > 0)
DoA();
else
DoB();if (x > 0) then
DoA()
else
DoB()
endwhile (count > 0)
{
count -= 1;
}while (count > 0) do
count = (count - 1)
endfor (int i = 0; i < 10; i++)
{
Process(i);
}local i = 0
while (i < 10) do
Process(i)
i = (i + 1)
endforeach (var item in items)
{
Use(item);
}for _, item in ipairs(items) do
Use(item)
endforeach (var item in list)
{
Use(item);
}for i = 1, SF__.ListCount__(list) do
local item = SF__.ListGet__(list, i)
Use(item)
endforeach (var kv in dict)
{
Use(kv.Key, kv.Value);
}for _, kv__ in ipairs(SF__.DictKeys__(dict)) do
local kv__key = kv__
local kv__val = SF__.DictGet__(dict, kv__)
Use(kv__key, kv__val)
endswitch on integer and string values is supported. Each section must end with break or return. Fall-through (no break/return) produces a transpiler error.
switch (x)
{
case 1:
DoA();
break;
case 2:
DoB();
break;
default:
DoC();
break;
}if (x == 1) then
DoA()
elseif (x == 2) then
DoB()
else
DoC()
endbreak and continue are supported inside while, for, and foreach. continue lowers to a goto continue__ jump.
do...while, goto (other than internal continue__), labeled statements, and switch with fall-through produce a transpiler error.