projects
/
onyx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
84b904f
)
fixed: #81 parsing bug
author
Brendan Hansen
<brendan.f.hansen@gmail.com>
Mon, 11 Dec 2023 00:10:15 +0000
(18:10 -0600)
committer
Brendan Hansen
<brendan.f.hansen@gmail.com>
Mon, 11 Dec 2023 00:10:15 +0000
(18:10 -0600)
compiler/src/parser.c
patch
|
blob
|
history
diff --git
a/compiler/src/parser.c
b/compiler/src/parser.c
index 5199e973ad439096469e6b6ce129f6d7cd0390a3..543e82be55326459ed8f9526d3e491488b585797 100644
(file)
--- a/
compiler/src/parser.c
+++ b/
compiler/src/parser.c
@@
-3114,6
+3114,11
@@
static b32 parse_possible_quick_function_definition(OnyxParser* parser, AstTyped
} else {
AstTyped* body = parse_compound_expression(parser, 0);
+ if (body == NULL) {
+ onyx_report_error(parser->curr->pos, Error_Critical, "Expected an expression here.");
+ parser->hit_unexpected_token = 1;
+ return 0;
+ }
AstReturn* return_node = make_node(AstReturn, Ast_Kind_Return);
return_node->token = body->token;