Simplify/Fix the state_flag behaviour for code generation

This commit is contained in:
gingerBill
2021-05-01 17:42:59 +01:00
parent 327116b84b
commit 406d2ab6ba
3 changed files with 22 additions and 31 deletions

View File

@@ -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;