]> git.saurik.com Git - bison.git/blobdiff - tests/named-refs.at
Merge branch 'maint'
[bison.git] / tests / named-refs.at
index d76e75f3a26164fb1e59d55518fd2c2b6b4a2591..8c0fbb90a240474bd2a69d47739ef3966582a35f 100644 (file)
@@ -46,10 +46,10 @@ static int power (int base, int exponent);
 %token <ival> NUM "number"
 %type  <ival> exp
 
-%nonassoc '='   /* comparison         */
+%nonassoc '='   /* comparison          */
 %left '-' '+'
 %left '*' '/'
-%left NEG /* negation--unary minus */
+%precedence NEG /* negation--unary minus */
 %right '^'      /* exponentiation        */
 
 %%
@@ -211,10 +211,10 @@ static int power (int base, int exponent);
 %token <ival> NUM "number"
 %type  <ival> exp
 
-%nonassoc '='   /* comparison         */
+%nonassoc '='   /* comparison          */
 %left '-' '+'
 %left '*' '/'
-%left NEG /* negation--unary minus */
+%precedence NEG /* negation--unary minus */
 %right '^'      /* exponentiation        */
 
 %%
@@ -253,7 +253,7 @@ exp:
 AT_BISON_CHECK([-o test.c test.y], 1, [],
 [[test.y:50.51-60: error: invalid reference: '$<ival>lo9'
 test.y:50.3-68:      symbol not found in production: lo9
-test.y:51.51-60: warning: misleading reference: '$<ival>exp'
+test.y:51.51-60: warning: misleading reference: '$<ival>exp' [-Wother]
 test.y:42.1-3:       refers to: $exp at $$
 test.y:51.7:         possibly meant: $x, hiding $exp at $1
 test.y:51.41:        possibly meant: $r, hiding $exp at $4
@@ -277,7 +277,7 @@ foo: '1'
 foo.bar: '2'
 ]])
 AT_BISON_CHECK([-o test.c test.y], 0, [],
-[[test.y:11.22-29: warning: misleading reference: '$foo.bar'
+[[test.y:11.22-29: warning: misleading reference: '$foo.bar' [-Wother]
 test.y:11.8-10:      refers to: $foo at $1
 test.y:11.12-18:     possibly meant: $[foo.bar] at $2
 ]])
@@ -443,14 +443,19 @@ AT_SETUP([Stray symbols in brackets])
 AT_DATA_GRAMMAR([test.y],
 [[
 %%
-start: foo[ /* aaa */ *&-.+ ] bar
+start: foo[ /* aaa */ *&-.+\000\001\002\377 ] bar
   { s = $foo; }
 ]])
+AT_CHECK([[$PERL -pi -e 's/\\(\d{3})/chr(oct($1))/ge' test.y || exit 77]])
 AT_BISON_CHECK([-o test.c test.y], 1, [],
 [[test.y:11.23: error: invalid character in bracketed name: '*'
 test.y:11.24: error: invalid character in bracketed name: '&'
 test.y:11.25: error: invalid character in bracketed name: '-'
 test.y:11.27: error: invalid character in bracketed name: '+'
+test.y:11.28: error: invalid character in bracketed name: '\0'
+test.y:11.28: error: invalid character in bracketed name: '\001'
+test.y:11.28: error: invalid character in bracketed name: '\002'
+test.y:11.28: error: invalid character in bracketed name: '\377'
 ]])
 AT_CLEANUP
 
@@ -573,7 +578,7 @@ start:
 ;
 ]])
 AT_BISON_CHECK([[test.y]], [[0]], [],
-[[test.y:4.9: warning: stray '$'
-test.y:5.9: warning: stray '@'
+[[test.y:4.9: warning: stray '$' [-Wother]
+test.y:5.9: warning: stray '@' [-Wother]
 ]])
 AT_CLEANUP