From 2b25d624f6e8290635dc42f1e5df4dd365f783d2 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 6 Jan 2002 20:50:08 +0000 Subject: [PATCH] * src/reader.c (parse_braces): Don't fetch the next char, the convention is to fetch on entry. * tests/torture.at (GNU Cim Grammar): Reintroduce their weird 'switch' without a following semicolon. * tests/regression.at (braces parsing): New. --- ChangeLog | 9 +++++++++ src/reader.c | 5 +---- tests/regression.at | 23 +++++++++++++++++++++++ tests/torture.at | 2 +- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41c5fcf7..c5a88c04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-01-06 Akim Demaille + + * src/reader.c (parse_braces): Don't fetch the next char, the + convention is to fetch on entry. + * tests/torture.at (GNU Cim Grammar): Reintroduce their weird + 'switch' without a following semicolon. + * tests/regression.at (braces parsing): New. + + 2002-01-06 Akim Demaille Bison is dead wrong in its RR conflict reports. diff --git a/src/reader.c b/src/reader.c index 9816c61d..cf3e18f3 100644 --- a/src/reader.c +++ b/src/reader.c @@ -1154,10 +1154,7 @@ parse_braces (symbol_list *rule, int stack_offset) /* Above loop exits when C is '}'. */ if (--count) - { - obstack_1grow (&action_obstack, c); - c = getc (finput); - } + obstack_1grow (&action_obstack, c); } obstack_1grow (&action_obstack, '\0'); diff --git a/tests/regression.at b/tests/regression.at index 76170124..849f526c 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -18,6 +18,29 @@ AT_BANNER([[Regression tests.]]) + +## ---------------- ## +## Braces parsing. ## +## ---------------- ## + + +AT_SETUP([braces parsing]) + +AT_DATA([input.y], +[[/* Bison used to swallow the character after `}'. */ + +%% +exp: { tests = {{{{{{{{{{}}}}}}}}}}; } +%% +]]) + +AT_CHECK([bison -v input.y -o input.c], 0, ignore, ignore) + +AT_CHECK([fgrep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c], 0, [ignore]) + +AT_CLEANUP + + ## ------------------ ## ## Duplicate string. ## ## ------------------ ## diff --git a/tests/torture.at b/tests/torture.at index cb25dedd..262a11d7 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -1208,7 +1208,7 @@ EXPRESSION_SIMP : EXPRESSION_SIMP case HLE: mout(MLE);break; case HGT: mout(MGT);break; case HGE: mout(MGE);break; - }; $$=NULL;} + }$$=NULL;} | EXPRESSION_SIMP HREFRELOPERATOR EXPRESSION_SIMP -- 2.45.2