diff options
| author | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-01-12 19:33:19 +0100 |
|---|---|---|
| committer | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-01-12 19:33:19 +0100 |
| commit | f34d41db5b8f72d3b82fa1c4e9fe3ad71f509d52 (patch) | |
| tree | d1490f4f54811c4b3b5213032ca8ec436f918ff3 /tests | |
| parent | 840d820d0951dc38e266bd4d184be2cf8bf142e3 (diff) | |
| parent | 32fa47b52b03f4ae84bc773bad785cf77334ae78 (diff) | |
| download | sylt-f34d41db5b8f72d3b82fa1c4e9fe3ad71f509d52.tar.gz | |
For-loops
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/simple.tdy | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/tests/simple.tdy b/tests/simple.tdy index 3fe05a4..2f0f606 100644 --- a/tests/simple.tdy +++ b/tests/simple.tdy @@ -13,12 +13,26 @@ // print d // print c -a int := 2 -if a == 0 { - print "123" -} else if a == 1 { - print "BCD" -} else { - print "ABC" +for a := 0, a < 10, print a { + print a + a = a + 1 } + // 1, 2, 3, 4 + + +// +// === main === +// | Constant(Int(0)) +// | ReadLocal(0) +// | Constant(Int(10)) +// | Less +// | JmpFalse(12) +// | Jmp(11) +// | Jmp(1) +// | ReadLocal(0) +// | Constant(Int(1)) +// | Add +// | Assign(0) +// | Jmp(7) +// | Return |
