use expect() to find the ] of an array access expression.
authorChristoph Mallon <christoph.mallon@gmx.de>
Tue, 4 Nov 2008 14:37:49 +0000 (14:37 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Tue, 4 Nov 2008 14:37:49 +0000 (14:37 +0000)
[r23432]

parser.c

index bc02cfc..a808c1d 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -7422,11 +7422,8 @@ static expression_t *parse_array_expression(expression_t *left)
        expression->base.type = automatic_type_conversion(return_type);
 
        rem_anchor_token(']');
-       if (token.type == ']') {
-               next_token();
-       } else {
-               parse_error_expected("Problem while parsing array access", ']', NULL);
-       }
+       expect(']');
+end_error:
        return expression;
 }