Revert "Allow last expression in code to not be terminated by a semicolon."
12660b1e4a
This commit is contained in:
parent
96b2dc234f
commit
987027c4fc
12
src/parser.c
12
src/parser.c
|
@ -361,17 +361,7 @@ libab_result _parse_statement(struct parser_state* state, libab_tree** store_int
|
|||
_parser_is_char(state, '(') ||
|
||||
_parser_is_type(state, TOKEN_OP_PREFIX)) {
|
||||
result = _parse_expression(state, store_into);
|
||||
if(result == LIBAB_SUCCESS) {
|
||||
if(_parser_is_char(state, ';') || _parser_eof(state)) {
|
||||
_parser_state_step(state);
|
||||
} else {
|
||||
result = LIBAB_UNEXPECTED;
|
||||
|
||||
libab_tree_free_recursive(*store_into);
|
||||
free(*store_into);
|
||||
*store_into = NULL;
|
||||
}
|
||||
}
|
||||
if(result == LIBAB_SUCCESS) result = _parser_consume_char(state, ';');
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue
Block a user