From 4cbc07ab946847cee922c73947b3169b44e2d5a6 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Mon, 27 Jun 2011 16:08:05 +0200 Subject: [PATCH] Improve error handling: Do not jump to the error_label if expect() finally finds the expected token after dropping some others. --- parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parser.c b/parser.c index c59790e..6f8c541 100644 --- a/parser.c +++ b/parser.c @@ -655,9 +655,9 @@ static void type_error_incompatible(const char *msg, parse_error_expected(NULL, (expected), NULL); \ add_anchor_token(expected); \ eat_until_anchor(); \ - next_if((expected)); \ rem_anchor_token(expected); \ - goto error_label; \ + if (token.type != (expected)) \ + goto error_label; \ } \ next_token(); \ } while (0) -- 2.20.1