Improve core:odin/parser

This commit is contained in:
gingerBill
2021-08-04 00:10:41 +01:00
parent 1f79082921
commit 57a17a708b
2 changed files with 108 additions and 20 deletions

View File

@@ -2169,7 +2169,7 @@ Ast *parse_operand(AstFile *f, bool lhs) {
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' be on the same line as the signature");
syntax_error(body, "The body of a 'do' must be on the same line as the signature");
}
return ast_proc_lit(f, type, body, tags, where_token, where_clauses);
@@ -3840,7 +3840,7 @@ Ast *parse_if_stmt(AstFile *f) {
else_stmt = convert_stmt_to_body(f, parse_stmt(f));
if (build_context.disallow_do) {
syntax_error(else_stmt, "'do' has been disallowed");
} else if (!ast_on_same_line(else_stmt, else_stmt)) {
} else if (!ast_on_same_line(else_token, else_stmt)) {
syntax_error(else_stmt, "The body of a 'do' be on the same line as 'else'");
}
} break;