From 4e2e269fab3f5facedc6ec0131f132bd66c0aac4 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Wed, 14 Sep 2022 14:05:03 -0400 Subject: Focus on ASM generation instead of raw binary --- tnslc/dummy.tnsl | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) (limited to 'tnslc/dummy.tnsl') 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 -- cgit v1.2.3