diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2024-03-30 02:46:04 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2024-03-30 02:46:04 -0400 |
commit | 59aabd4ed77ff3ede1df368ad134c56a6f8787c0 (patch) | |
tree | 0dc74f277fa35eb7ec9d72cc793da094b18b4686 /tnslc/tnslc.tnsl | |
parent | a282af0b8fd4102778d6d8781c29f1c0202e13ee (diff) |
in_csv function
Diffstat (limited to 'tnslc/tnslc.tnsl')
-rw-r--r-- | tnslc/tnslc.tnsl | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/tnslc/tnslc.tnsl b/tnslc/tnslc.tnsl index 852d22e..0123430 100644 --- a/tnslc/tnslc.tnsl +++ b/tnslc/tnslc.tnsl @@ -17,7 +17,8 @@ usage: ~uint8 char_str = "%c\0" ~uint8 newline = "\n\0" -~uint8 scratch = "1234\0" +~uint8 scratch = "asd,efg\0" +~uint8 test = "asd\0" /; main (int argc, ~~uint8 argv) [int] asm "mov r10, rdi" @@ -28,13 +29,24 @@ usage: return 1 ;/ - int i = utils.cstr_to_int(scratch) - _print_num(utils.NUM_STR, 0 - i) - i = 0 - i - ~uint8 s = utils.int_to_str(i) - _printf(s) - _printf(newline) - _delete(s) + /; if (compile._in_csv(scratch, test)) + _printf(test) + _printf(newline) + ;/ + + utils.File fin, fout + fin.init(argv{1}) + + /; if (argc > 2) + fout.init(argv{2}) + ;; else + fout.init(DEFAULT_FOUT) + ;/ + + compile.generate(fin, fout) + + fin.end() + fout.end() return 0 ;/ |