Skip to content

Commit

Permalink
add: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
zestones committed Dec 30, 2024
1 parent 895595f commit ff181b1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/parser/grammar.y
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ return_statement: RETURN_VALUE expression SEMICOLON {
yyerror("Return statement is not allowed outside of a function.");
}
int index_declaration = find_function_index_by_region(peek_region());
// Check if function exist otherwise we are inside a procedure
if (index_declaration == NULL_VALUE) {
set_error_type(&error, SYNTAX_ERROR);
yyerror("Return statement is not allowed outside of a function.");
Expand Down

0 comments on commit ff181b1

Please sign in to comment.