summaryrefslogtreecommitdiff
path: root/tnslc/test.tnsl
diff options
context:
space:
mode:
authorKai Gunger <kgunger12@gmail.com>2026-07-11 05:56:21 -0400
committerKai Gunger <kgunger12@gmail.com>2026-07-11 05:56:21 -0400
commit4fbc5d6511a404319a5392f96b105823a63de893 (patch)
tree7e6a7f61df15cb29a333625da17bf9dfae049533 /tnslc/test.tnsl
parentf0f441ed214e72980db254d3f5b238ec17c42420 (diff)
[tnslc] Tokenizer bootstrap
Diffstat (limited to 'tnslc/test.tnsl')
-rw-r--r--tnslc/test.tnsl43
1 files changed, 31 insertions, 12 deletions
diff --git a/tnslc/test.tnsl b/tnslc/test.tnsl
index a130386..7570215 100644
--- a/tnslc/test.tnsl
+++ b/tnslc/test.tnsl
@@ -1,20 +1,39 @@
+import "utils/utils.tnsl"
+import "parse/parse.tnsl"
+# :import "compile/compile.tnsl"
-struct TTT {
- int a, b, c
-}
+~uint8 USAGE = "
+TNSLP v0.1.0 (C) 2026 CircleShift (MPL 2.0)
-/; asdf [TTT]
- TTT out
- out.a = 0
- out.b = 0
- return out
-;/
+usage:
+ tnslp (file in)
+ generates a parse tree of the given file
+
+\0"
+
+~uint8 FOPEN_ERR = "Error opening file\n\0"
+
+~uint8 char_str = "%c\0"
+~uint8 newline = "\n\0"
/; main (int argc, ~~uint8 argv) [int]
+ asm "mov r10, rdi"
+ asm "mov r11, rsi"
+
+ /; if (argc < 2)
+ _printf(USAGE)
+ return 1
+ ;/
+
+ utils.File fin
+ fin.init(argv{1})
+
+ utils.Vector vec = parse.gen_token_list(~fin)
+ parse.print_token_list(~vec)
+ parse.end_token_list(~vec)
- TTT out
- out = asdf()
+ fin.end()
- return out.a
+ return 0
;/