aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-05-01 17:42:59 +0100
committergingerBill <bill@gingerbill.org>2021-05-01 17:42:59 +0100
commit406d2ab6ba8a5906df634fc5f00c40b6983a0c39 (patch)
treea8dadbb9937b17857ef39cc1bf911b6662994704 /src/parser.cpp
parent327116b84b946fc76d4f09c1b8fe255480d68abc (diff)
Simplify/Fix the state_flag behaviour for code generation
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index a6764de08..c9275c7f2 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -2170,6 +2170,14 @@ Ast *parse_operand(AstFile *f, bool lhs) {
body = parse_body(f);
f->curr_proc = curr_proc;
+ // Apply the tags directly to the body rather than the type
+ if (tags & ProcTag_no_bounds_check) {
+ body->state_flags |= StateFlag_no_bounds_check;
+ }
+ if (tags & ProcTag_bounds_check) {
+ body->state_flags |= StateFlag_bounds_check;
+ }
+
return ast_proc_lit(f, type, body, tags, where_token, where_clauses);
} else if (allow_token(f, Token_do)) {
Ast *curr_proc = f->curr_proc;