summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
48047e0)
- Handle EOF generically with expect().
- Do not skip semantic checks, when breaking out of the parsing loop due to an error.
statement_t **anchor = &statement->compound.statements;
bool only_decls_so_far = true;
statement_t **anchor = &statement->compound.statements;
bool only_decls_so_far = true;
- while (token.kind != '}') {
- if (token.kind == T_EOF) {
- errorf(&statement->base.source_position,
- "EOF while parsing compound statement");
- break;
- }
+ while (token.kind != '}' && token.kind != T_EOF) {
statement_t *sub_statement = intern_parse_statement();
if (sub_statement->kind == STATEMENT_ERROR) {
statement_t *sub_statement = intern_parse_statement();
if (sub_statement->kind == STATEMENT_ERROR) {
}
if (sub_statement->kind != STATEMENT_DECLARATION) {
}
if (sub_statement->kind != STATEMENT_DECLARATION) {
*anchor = sub_statement;
anchor = &sub_statement->base.next;
}
*anchor = sub_statement;
anchor = &sub_statement->base.next;
}
+ expect('}', end_error);
+end_error:
/* look over all statements again to produce no effect warnings */
if (is_warn_on(WARN_UNUSED_VALUE)) {
/* look over all statements again to produce no effect warnings */
if (is_warn_on(WARN_UNUSED_VALUE)) {
rem_anchor_token(T_while);
rem_anchor_token(T_wchar_t);
rem_anchor_token(T_volatile);
rem_anchor_token(T_while);
rem_anchor_token(T_wchar_t);
rem_anchor_token(T_volatile);