0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-25 11:17:50 +01:00
posthog/hogvm/__tests__/loops.hog

28 lines
422 B
Plaintext
Raw Normal View History

print('-- test while loop --')
{
let i := 0
while (i < 3) {
i := i + 1
print(i)
}
print(i)
}
print('-- test for loop --')
{
for (let i := 0; i < 3; i := i + 1) {
print(i) -- prints 3 times
}
print(i) -- global does not print
}
print('-- test emptier for loop --')
{
let i := 0;
for (;i < 3;) {
print('woo')
i := i + 1;
}
print('hoo')
}