aboutsummaryrefslogtreecommitdiffstats
path: root/progs/tests/for.sy
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-02-01 21:57:54 +0100
committerEdvard Thörnros <edvard.thornros@gmail.com>2021-02-01 21:57:54 +0100
commit5b9de776ba7de654fa92bee7c38fb30d7929405d (patch)
tree9326e2f44b56f050df229eef331a3ab6248ebbdb /progs/tests/for.sy
parentf9b6a64b845dabdf1773da49f248def479659934 (diff)
downloadsylt-5b9de776ba7de654fa92bee7c38fb30d7929405d.tar.gz
.tdy -> .sy and tests -> progs/tests
Diffstat (limited to 'progs/tests/for.sy')
-rw-r--r--progs/tests/for.sy19
1 files changed, 19 insertions, 0 deletions
diff --git a/progs/tests/for.sy b/progs/tests/for.sy
new file mode 100644
index 0000000..a9f8cd2
--- /dev/null
+++ b/progs/tests/for.sy
@@ -0,0 +1,19 @@
+a := 0
+for i := 0, i < 3, i = i + 1 {
+ a = a + i
+}
+a <=> 3
+
+a = 0
+for i := 0, i <= 3, i = i + 1 {
+ a = a + i
+}
+a <=> 6
+
+a = 0
+for i := 0, i < 3, i = i + 1 {
+ for j := 0, j < 3, j = j + 1 {
+ a = a + i * j
+ }
+}
+a <=> 9