summaryrefslogtreecommitdiff
path: root/compiler.c
diff options
context:
space:
mode:
Diffstat (limited to 'compiler.c')
-rw-r--r--compiler.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler.c b/compiler.c
index 37383fa..a5181b1 100644
--- a/compiler.c
+++ b/compiler.c
@@ -819,6 +819,26 @@ bool tnsl_is_boolean() {
return false;
}
+int tnsl_find_closing(Vector *tokens, size_t cur) {
+ char closing = 0;
+
+ Token *check = vect_get(tokens, cur);
+
+ if (tok_str_eq(check, "(")) {
+ closing = ')';
+ } else if (tok_str_eq(check, "[")) {
+ closing = ']';
+ } else if (tok_str_eq(check, "{")) {
+ closing = '}';
+ } else if (tok_str_eq(check, "/;") || tok_str_eq(check, ";;")) {
+ closing = ';';
+ }
+
+ int out = cur;
+
+ return out;
+}
+
// Phase 1 - Module building
bool p1_error = false;