From 406d2ab6ba8a5906df634fc5f00c40b6983a0c39 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 1 May 2021 17:42:59 +0100 Subject: Simplify/Fix the state_flag behaviour for code generation --- src/parser.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/parser.cpp') 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; -- cgit v1.2.3