summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2024-07-30 21:21:12 -0400
committerKyle Gunger <kgunger12@gmail.com>2024-07-30 21:21:12 -0400
commit52bf655a3f2c89351574a64418d9a71f09e80425 (patch)
tree0c7c2a60c5f421f2bf79010437587e3a56deeafb
parent7f43de56335ebd0bdfc3a03fed7f817f2f1781d3 (diff)
maybe helper decl
-rw-r--r--tnslc/parse/ast.tnsl14
1 files changed, 13 insertions, 1 deletions
diff --git a/tnslc/parse/ast.tnsl b/tnslc/parse/ast.tnsl
index 5bf84c8..b55bc74 100644
--- a/tnslc/parse/ast.tnsl
+++ b/tnslc/parse/ast.tnsl
@@ -91,6 +91,9 @@ struct Node {
# AST lists
+/; _maybe_helper_decl (~utils.File fin, ~Node mod, )
+;/
+
/; _ast_list_decl (~utils.File fin, ~Node mod, ~Token first)
Node list
list.init(NTYPE_DLIST)
@@ -100,7 +103,16 @@ struct Node {
first` = produce_next_token(fin, first`)
/; loop (first`._type !== TTYPE_ERR && first`.data` !== end)
- # TODO
+ /; if (first`._type == TTYPE_KEYTP || first`.eq("~\0") == true || first`.eq("{\0") == true)
+ _ast_type(fin, ~list, first)
+ ;; else if (first`._type == TTYPE_USRWD)
+ _maybe_helper_decl(fin, ~list, first)
+ ;; else
+ _ast_print_err(first, "Expected type or parameter name in declaration list\0")
+ mod`.sub.push(~list)
+ return
+ ;/
+
;/
mod`.sub.push(~list)