summaryrefslogtreecommitdiff
path: root/tnslc/dummy.tnsl
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-09-14 14:05:03 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-09-14 14:05:03 -0400
commit4e2e269fab3f5facedc6ec0131f132bd66c0aac4 (patch)
treedab2c175c4c81c3665703c800d07bb1d775821e0 /tnslc/dummy.tnsl
parent37d1e9fa02b27d1a6c56b4c95d31e6d2b9eab9ee (diff)
Focus on ASM generation instead of raw binary
Diffstat (limited to 'tnslc/dummy.tnsl')
-rw-r--r--tnslc/dummy.tnsl42
1 files changed, 30 insertions, 12 deletions
diff --git a/tnslc/dummy.tnsl b/tnslc/dummy.tnsl
index 12b082e..8fdb165 100644
--- a/tnslc/dummy.tnsl
+++ b/tnslc/dummy.tnsl
@@ -1,12 +1,30 @@
-;int a = 0x11
-;bool aaaa = false
-
-/; main
- /; if (a !== 11)
- ;tnsl.io.println(a)
- ;/
-
- /; loop (!aaaa) [a !== 17]
- ;tnsl.io.println("Looping!")
- ;/
-;/
+; struct Token {
+ int
+ token_type,
+ line,
+ col,
+
+ ~{}charp
+ data
+}
+
+;struct Node {
+ Token
+ # associated token to the node
+ tok,
+
+ ~{}Node
+ # sub-nodes
+ sub
+}
+
+;{}charp cnull = "a"
+
+/; main [int]
+ ;{}Node s = {}
+ ;Node n = {{1, 2, 3, ~cnull}, ~s}
+ ;s.append(n)
+ ;tnsl.io.println(~s)
+ ;tnsl.io.println(n.sub)
+ ;return 0
+;/ \ No newline at end of file