diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2023-02-16 05:14:31 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2023-02-16 05:14:31 -0500 |
commit | 09df1bb48823631228af3df647111af1eebc854b (patch) | |
tree | ef091fc942b00b224f7d66aacb0c3db0ab4d490c /tnslc/parse/parse.tnsl | |
parent | c94edbe007910755087e71cbb1a6a349d75e9b85 (diff) |
Collapse tnslc into a single file
Diffstat (limited to 'tnslc/parse/parse.tnsl')
-rw-r--r-- | tnslc/parse/parse.tnsl | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/tnslc/parse/parse.tnsl b/tnslc/parse/parse.tnsl deleted file mode 100644 index 8919c3a..0000000 --- a/tnslc/parse/parse.tnsl +++ /dev/null @@ -1,87 +0,0 @@ -/## - Copyright 2021-2022 Kyle Gunger - - This file is licensed under the CDDL 1.0 (the License) - and may only be used in accordance with the License. - You should have received a copy of the License with this - software/source code. If you did not, a copy can be found - at the following URL: - - https://opensource.org/licenses/CDDL-1.0 - - THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO - WARRANTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE - EXPRESS OR IMPLIED -#/ - -/; export module parse - :include "parse/token.tnsl" - :include "parse/tokenizer.tnsl" -;/ - -/; create_panic ({}uint8 err) - ;tnsl.io.println("ABOUT TO INDUCE PANIC... STAND BY") - ;tnsl.io.print("Error code given: ") - ;tnsl.io.println(err) - ;{}int i = {0} - ;i{2} -;/ - -/# The various types of tokens #/ -; enum TOKEN_TYPE [int] { - LINESEP = 0, - INLNSEP = 1, - DELIMIT = 2, - AUGMENT = 3, - LITERAL = 4, - KEYTYPE = 5, - PREWORD = 6, - KEYWORD = 7, - DEFWORD = 8 -} - -/# Token struct definition #/ -; struct Token { - int - token_type, - line, - col, - - ~{}uint8 - data -} - -/; method Token - - /; print - ;tnsl.io.print("{ ") - ;tnsl.io.print(self.token_type) - ;tnsl.io.print(" ") - ;tnsl.io.print(self.data`) - ;tnsl.io.print(" ") - ;tnsl.io.print(self.line) - ;tnsl.io.print(" ") - ;tnsl.io.print(self.col) - ;tnsl.io.print(" } ") - ;/ - - /; operator delete - ;delete self.data - ;/ - - /; add_char (~{}uint8 part) - # ;uint l = len self.data` - # ;realloc self.data, l + len part - /; loop (int i = 0; i < len part`) [i++] - # ;self.data`{l + i} = part{i} - ;self.data`.append(part`{i}) - ;/ - ;/ -;/ - -/; print_tokens(~{}Token dat) - /; loop (int i = 0; i < len dat`) [i++] - ;dat`{i}.print() - ;/ - ;tnsl.io.print("\n") -;/ |