aboutsummaryrefslogtreecommitdiff
path: root/src/parser.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-07-18 15:09:04 +0100
committergingerBill <bill@gingerbill.org>2022-07-18 15:09:04 +0100
commit22a0c3fce1b41c62a2038060b592e0ae79912d4d (patch)
treeb40e0f90301220c84cccd1b37cb06944534b54c2 /src/parser.cpp
parent6c7e5748a8ee80b01b99fe41192d4aac32651849 (diff)
Disallow `proc() do stmt` and only allow `proc() { stmt }`
Diffstat (limited to 'src/parser.cpp')
-rw-r--r--src/parser.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/parser.cpp b/src/parser.cpp
index a6f30cdfd..dd9d6f036 100644
--- a/src/parser.cpp
+++ b/src/parser.cpp
@@ -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);
}