mirror of
https://github.com/odin-lang/Odin.git
synced 2026-06-04 01:34:39 +00:00
Disallow proc() do stmt and only allow proc() { stmt }
This commit is contained in:
@@ -2324,11 +2324,7 @@ Ast *parse_operand(AstFile *f, bool lhs) {
|
||||
body = convert_stmt_to_body(f, parse_stmt(f));
|
||||
f->curr_proc = curr_proc;
|
||||
|
||||
if (build_context.disallow_do) {
|
||||
syntax_error(body, "'do' has been disallowed");
|
||||
} else if (!ast_on_same_line(type, body)) {
|
||||
syntax_error(body, "The body of a 'do' must be on the same line as the signature");
|
||||
}
|
||||
syntax_error(body, "'do' for procedure bodies is not allowed, prefer {}");
|
||||
|
||||
return ast_proc_lit(f, type, body, tags, where_token, where_clauses);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user