projects
/
onyx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
16afba0
)
fixed: optional semicolons on naked return statement
author
Brendan Hansen
<brendan.f.hansen@gmail.com>
Thu, 8 Feb 2024 22:03:25 +0000
(16:03 -0600)
committer
Brendan Hansen
<brendan.f.hansen@gmail.com>
Thu, 8 Feb 2024 22:03:25 +0000
(16:03 -0600)
compiler/src/parser.c
patch
|
blob
|
history
diff --git
a/compiler/src/parser.c
b/compiler/src/parser.c
index a2aee9e411416cae239068d75285744e87e3e8ba..e39791182d43d21aa8223426773dabb4c8ad9092 100644
(file)
--- a/
compiler/src/parser.c
+++ b/
compiler/src/parser.c
@@
-1663,7
+1663,7
@@
static AstReturn* parse_return_stmt(OnyxParser* parser) {
AstTyped* expr = NULL;
- if (parser->curr->type != ';') {
+ if (parser->curr->type != ';'
&& parser->curr->type != Token_Type_Inserted_Semicolon
) {
expr = parse_compound_expression(parser, 0);
if (expr == NULL || expr == (AstTyped *) &error_node) {
@@
-2363,6
+2363,7
@@
static AstStructType* parse_struct(OnyxParser* parser) {
if (parse_possible_tag(parser)) {
consume_token_if_next(parser, ';');
+ continue;
}
if (parse_possible_directive(parser, "persist")) {