aboutsummaryrefslogtreecommitdiffstats
path: root/tests/simple.tdy
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-01-14 21:10:07 +0100
committerGustav Sörnäs <gustav@sornas.net>2021-01-15 16:57:56 +0100
commit7ec991b8d6654aaf27a005804347346e16500a47 (patch)
treebf36be24f2a8dffa4589aecfce75d0f0bf55f440 /tests/simple.tdy
parent4e6071aee97a26610aeee423d830a695b8c4d563 (diff)
downloadsylt-7ec991b8d6654aaf27a005804347346e16500a47.tar.gz
Start of typesystem
There's a type system, that kinda works There needs to be better parsing of types, since not all types are currently parsable. Some of them are, and the simple stuff works! :D
Diffstat (limited to 'tests/simple.tdy')
-rw-r--r--tests/simple.tdy44
1 files changed, 10 insertions, 34 deletions
diff --git a/tests/simple.tdy b/tests/simple.tdy
index 2f0f606..6dde932 100644
--- a/tests/simple.tdy
+++ b/tests/simple.tdy
@@ -1,38 +1,14 @@
-// 1 + 1 <=> 2
-// // asdlkjasl
-// print 1 + 3
-// // OwO
-
-// a int := 0
-// b int := 1
-// c int := 3
-// d int := 2
+// a := 1
+// a = 2 + 1
+// a = 3
//
-// print a
-// print b
-// print d
-// print c
+// for i := 0, i < 10, i = i + 1 {
+// print i + 1
+// print i + 2
+// }
-for a := 0, a < 10, print a {
- print a
- a = a + 1
+f := fn b: int -> int {
+ ret b + 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
+f(1)