mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
muscles: fix incorrect decoding of $
Bug introduced in 458171e6df.
https://lists.gnu.org/archive/html/bison-patches/2013-11/msg00009.html
Reported by Ahcheong Lee.
https://lists.gnu.org/r/bug-bison/2020-03/msg00010.html
* src/muscle-tab.c (COMMON_DECODE): "$" is coded as "$][", not "$[][".
* tests/input.at ("%define" enum variables): Check that case.
This commit is contained in:
@@ -2069,6 +2069,25 @@ input.y:1.1-34: accepted value: 'consistent'
|
||||
input.y:1.1-34: accepted value: 'accepting'
|
||||
]])
|
||||
|
||||
# Check escapes.
|
||||
AT_DATA([[input.y]],
|
||||
[[%define lr.default-reduction {[$@]}
|
||||
%%
|
||||
start: %empty;
|
||||
]])
|
||||
AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]],
|
||||
[[input.y:1.1-35: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated]
|
||||
1 | %define lr.default-reduction {[$@]}
|
||||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
input.y:1.1-35: error: invalid value for %define variable 'lr.default-reduction': '[$@]'
|
||||
1 | %define lr.default-reduction {[$@]}
|
||||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
input.y:1.1-35: accepted value: 'most'
|
||||
input.y:1.1-35: accepted value: 'consistent'
|
||||
input.y:1.1-35: accepted value: 'accepting'
|
||||
]])
|
||||
|
||||
|
||||
# Back-end.
|
||||
AT_DATA([[input.y]],
|
||||
[[%define api.push-pull neither
|
||||
|
||||
Reference in New Issue
Block a user