diff options
author | Bad Diode <bd@badd10de.dev> | 2024-06-18 22:19:24 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2024-06-18 22:19:24 +0200 |
commit | faf69726d4fc619bc55a2c1105bd542673cce342 (patch) | |
tree | 8145281c300f9248c834deabf003811589e3eec8 /tests | |
parent | ad14773fcebdbd989c1d7c3245b59a1cae666d2f (diff) | |
download | bdl-faf69726d4fc619bc55a2c1105bd542673cce342.tar.gz bdl-faf69726d4fc619bc55a2c1105bd542673cce342.zip |
Add basic while loop
Diffstat (limited to 'tests')
-rw-r--r-- | tests/loops.bad | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/loops.bad b/tests/loops.bad new file mode 100644 index 0000000..5221844 --- /dev/null +++ b/tests/loops.bad | |||
@@ -0,0 +1,18 @@ | |||
1 | ; The most basic loop is the while loop. | ||
2 | while abc = "heelo" | ||
3 | |||
4 | while 1 + 2 == 3 = { | ||
5 | "hello" | ||
6 | } | ||
7 | |||
8 | while symbol = { | ||
9 | "hello" | ||
10 | } | ||
11 | |||
12 | |||
13 | ; We could use some sugar for this. | ||
14 | let i = 0 | ||
15 | while i < 10 = { | ||
16 | "hello" | ||
17 | set i = i + 1 | ||
18 | } | ||