*/
static statement_t *parse_continue(void)
{
- statement_base_t *statement;
+ statement_t *statement;
if (current_loop == NULL) {
errorf(HERE, "continue statement not within loop");
statement = NULL;
} else {
- statement = allocate_ast_zero(sizeof(statement[0]));
- statement->kind = STATEMENT_CONTINUE;
- statement->source_position = token.source_position;
+ statement = allocate_statement_zero(STATEMENT_CONTINUE);
+
+ statement->base.source_position = token.source_position;
}
eat(T_continue);
expect(';');
- return (statement_t*)statement;
+ return statement;
}
/**
*/
static statement_t *parse_break(void)
{
- statement_base_t *statement;
+ statement_t *statement;
if (current_switch == NULL && current_loop == NULL) {
errorf(HERE, "break statement not within loop or switch");
statement = NULL;
} else {
- statement = allocate_ast_zero(sizeof(statement[0]));
- statement->kind = STATEMENT_BREAK;
- statement->source_position = token.source_position;
+ statement = allocate_statement_zero(STATEMENT_BREAK);
+
+ statement->base.source_position = token.source_position;
}
eat(T_break);
expect(';');
- return (statement_t*)statement;
+ return statement;
}
/**