summaryrefslogtreecommitdiff
path: root/tnslc/parse
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-05-05 16:14:01 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-05-05 16:14:01 -0400
commit2572cd049ee5e1e2685b1abe6bfcfbb8aa988a71 (patch)
treeb191126f961c6befc6da2c65c28d5bef69077579 /tnslc/parse
parent5cf518362e6bc08eb44eb8d6ed74a0a23c2c3a5f (diff)
Add methods to crash in a defined way
Diffstat (limited to 'tnslc/parse')
-rw-r--r--tnslc/parse/parse.tnsl12
1 files changed, 10 insertions, 2 deletions
diff --git a/tnslc/parse/parse.tnsl b/tnslc/parse/parse.tnsl
index 9927d56..dbd9354 100644
--- a/tnslc/parse/parse.tnsl
+++ b/tnslc/parse/parse.tnsl
@@ -19,6 +19,14 @@
:include "parse/tokenizer.tnsl"
;/
+/; create_panic ({}charp 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,
@@ -64,7 +72,7 @@
/; add_char (~{}charp part)
# ;uint l = len self.data`
# ;realloc self.data, l + len part
- /;loop (int i = 0; i < len part`) [i++]
+ /; loop (int i = 0; i < len part`) [i++]
# ;self.data`{l + i} = part{i}
;self.data`.append(part`{i})
;/
@@ -72,7 +80,7 @@
;/
/; print_tokens(~{}Token dat)
- /;loop (int i = 0; i < len dat`) [i++]
+ /; loop (int i = 0; i < len dat`) [i++]
;dat`{i}.print()
;/
;tnsl.io.print("\n")