From fb42589fd477ec7892f224e71d9be3820d0106c6 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Wed, 25 Apr 2012 09:11:07 +0200 Subject: [PATCH] Move adding/removing ';' as anchor from intern_parse_statement() to parse_compound_statement(). It is already an anchor at {.S*} and then needs not to be repeated in intern_parse_statement() (and only adding ';' is a bit poor). --- parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index 200f5ae..18c59f6 100644 --- a/parser.c +++ b/parser.c @@ -10001,7 +10001,6 @@ static statement_t *intern_parse_statement(void) statement_t *statement = NULL; /* declaration or statement */ - add_anchor_token(';'); switch (token.kind) { case T_IDENTIFIER: { token_kind_t la1_type = (token_kind_t)look_ahead(1)->kind; @@ -10075,7 +10074,6 @@ static statement_t *intern_parse_statement(void) eat_until_anchor(); break; } - rem_anchor_token(';'); assert(statement != NULL && statement->base.source_position.input_name != NULL); @@ -10123,6 +10121,7 @@ static statement_t *parse_compound_statement(bool inside_expression_statement) add_anchor_token('*'); add_anchor_token('+'); add_anchor_token('-'); + add_anchor_token(';'); add_anchor_token('{'); add_anchor_token('~'); add_anchor_token(T_CHARACTER_CONSTANT); @@ -10335,6 +10334,7 @@ end_error: rem_anchor_token(T_CHARACTER_CONSTANT); rem_anchor_token('~'); rem_anchor_token('{'); + rem_anchor_token(';'); rem_anchor_token('-'); rem_anchor_token('+'); rem_anchor_token('*'); -- 2.20.1