]> git.saurik.com Git - bison.git/blobdiff - tests/input.at
syncline: one line is enough
[bison.git] / tests / input.at
index 50af0a863f9e4da149bce73f13b4cd22a52d5b63..385d0f3a9c1953a9d1949be63cee0d86e0c6d278 100644 (file)
@@ -1270,7 +1270,7 @@ AT_CLEANUP
 ## %define Boolean variables.  ##
 ## --------------------------- ##
 
-AT_SETUP([[%define Boolean variables]])
+AT_SETUP([["%define" Boolean variables]])
 
 AT_DATA([Input.y],
 [[%language "Java"
@@ -1290,7 +1290,11 @@ AT_CLEANUP
 ## %define enum variables.  ##
 ## ------------------------ ##
 
-AT_SETUP([[%define enum variables]])
+AT_SETUP([["%define" enum variables]])
+
+# Check errors from the front-end, and the back-end.  Since the
+# front-end quits before calling the back-end, these tests cannot be
+# fused.
 
 # Front-end.
 AT_DATA([[input.y]],
@@ -1298,22 +1302,25 @@ AT_DATA([[input.y]],
 %%
 start: ;
 ]])
-AT_BISON_CHECK([[input.y]], [[1]], [[]],
+AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]],
 [[input.y:1.9-28: error: invalid value for %define variable 'lr.default-reduction': 'bogus'
+ %define lr.default-reduction bogus
+         ^^^^^^^^^^^^^^^^^^^^
 input.y:1.9-28:     accepted value: 'most'
 input.y:1.9-28:     accepted value: 'consistent'
 input.y:1.9-28:     accepted value: 'accepting'
 ]])
 
 # Back-end.
-# FIXME: these should be indented, but we shouldn't mess with the m4 yet
 AT_DATA([[input.y]],
 [[%define api.push-pull neither
 %%
 start: ;
 ]])
-AT_BISON_CHECK([[input.y]], [1], [],
+AT_BISON_CHECK([[-fcaret input.y]], [[1]], [[]],
 [[input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither'
+ %define api.push-pull neither
+         ^^^^^^^^^^^^^
 input.y:1.9-21:     accepted value: 'pull'
 input.y:1.9-21:     accepted value: 'push'
 input.y:1.9-21:     accepted value: 'both'
@@ -1325,65 +1332,37 @@ AT_CLEANUP
 ## %define backward compatibility.  ##
 ## -------------------------------- ##
 
-AT_SETUP([[%define backward compatibility]])
-
-# The error messages tell us whether underscores in these variables are
-# being converted to dashes.
+AT_SETUP([["%define" backward compatibility]])
 
+# The error messages tell us whether the variables are properly updated.
 AT_DATA([[input.y]],
-[[%define api.push_pull "neither"
+[[%define api.push_pull both
+%define lr.keep_unreachable_states maybe
+%define namespace "foo"
+%define api.namespace "foo"
+%define variant
 %%
 start: ;
 ]])
-AT_BISON_CHECK([[input.y]], [1], [],
-[[input.y:1.9-21: warning: deprecated directive: '%define api.push_pull neither', use '%define api.push-pull neither' [-Wdeprecated]
-input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither'
-input.y:1.9-21:     accepted value: 'pull'
-input.y:1.9-21:     accepted value: 'push'
-input.y:1.9-21:     accepted value: 'both'
-]])
-
 AT_BISON_CHECK([[-fcaret input.y]], [1], [],
-[[input.y:1.9-21: warning: deprecated directive, use '%define api.push-pull neither' [-Wdeprecated]
- %define api.push_pull "neither"
+[[input.y:1.9-21: warning: deprecated directive, use '%define api.push-pull both' [-Wdeprecated]
+ %define api.push_pull both
          ^^^^^^^^^^^^^
-input.y:1.9-21: error: invalid value for %define variable 'api.push-pull': 'neither'
- %define api.push_pull "neither"
+input.y:2.9-34: warning: deprecated directive, use '%define lr.keep-unreachable-state maybe' [-Wdeprecated]
+ %define lr.keep_unreachable_states maybe
+         ^^^^^^^^^^^^^^^^^^^^^^^^^^
+input.y:3.9-17: warning: deprecated directive, use '%define api.namespace foo' [-Wdeprecated]
+ %define namespace "foo"
+         ^^^^^^^^^
+input.y:4.9-21: error: %define variable 'api.namespace' redefined
+ %define api.namespace "foo"
          ^^^^^^^^^^^^^
-input.y:1.9-21:     accepted value: 'pull'
-input.y:1.9-21:     accepted value: 'push'
-input.y:1.9-21:     accepted value: 'both'
-]])
-
-AT_DATA([[input.y]],
-[[%define lr.keep_unreachable_states maybe
-%%
-start: ;
-]])
-AT_BISON_CHECK([[input.y]], [1], [],
-[[input.y:1.9-34: warning: deprecated directive: '%define lr.keep_unreachable_states maybe', use '%define lr.keep-unreachable-state maybe' [-Wdeprecated]
-input.y:1.9-34: error: invalid value for %define Boolean variable 'lr.keep-unreachable-state'
-]])
-
-AT_DATA([[input.y]],
-[[%define namespace "foo"
-%define api.namespace "foo"
-%%
-start: ;
-]])
-AT_BISON_CHECK([[input.y]], [1], [],
-[[input.y:1.9-17: warning: deprecated directive: '%define namespace foo', use '%define api.namespace foo' [-Wdeprecated]
-input.y:2.9-21: error: %define variable 'api.namespace' redefined
-input.y:1.9-17:     previous definition
-]])
-
-AT_DATA([[input.y]],
-[[%define foo_bar "baz"
-%%
-start: ;
-]])
-AT_BISON_CHECK([[input.y]], [[1]], [],
-[[input.y:1.9-15: error: %define variable 'foo_bar' is not used
+input.y:3.9-17:     previous definition
+ %define namespace "foo"
+         ^^^^^^^^^
+input.y:5.9-15: warning: deprecated directive, use '%define api.value.type variant' [-Wdeprecated]
+ %define variant
+         ^^^^^^^
 ]])
 
 AT_CLEANUP
@@ -1490,12 +1469,22 @@ start: '
 ]])
 AT_CHECK([[$PERL -e "print 'start: \'';" >> empty.y || exit 77]])
 
-AT_BISON_CHECK([empty.y], [1], [],
+AT_BISON_CHECK([-fcaret empty.y], [1], [],
 [[empty.y:2.8-9: warning: empty character literal [-Wother]
-empty.y:3.8-4.0: warning: empty character literal [-Wother]
+ start: '';
+        ^^
 empty.y:3.8-4.0: error: missing "'" at end of line
-empty.y:4.8: warning: empty character literal [-Wother]
+ start: '
+        ^
+empty.y:3.8-4.0: warning: empty character literal [-Wother]
+ start: '
+        ^
 empty.y:4.8: error: missing "'" at end of file
+ start: '
+        ^
+empty.y:4.8: warning: empty character literal [-Wother]
+ start: '
+        ^
 ]])
 
 AT_DATA([two.y],
@@ -1507,10 +1496,10 @@ AT_CHECK([[$PERL -e "print 'start: \'ab';" >> two.y || exit 77]])
 
 AT_BISON_CHECK([two.y], [1], [],
 [[two.y:2.8-11: warning: extra characters in character literal [-Wother]
-two.y:3.8-4.0: warning: extra characters in character literal [-Wother]
 two.y:3.8-4.0: error: missing "'" at end of line
-two.y:4.8-10: warning: extra characters in character literal [-Wother]
+two.y:3.8-4.0: warning: extra characters in character literal [-Wother]
 two.y:4.8-10: error: missing "'" at end of file
+two.y:4.8-10: warning: extra characters in character literal [-Wother]
 ]])
 
 AT_DATA([three.y],
@@ -1522,10 +1511,10 @@ AT_CHECK([[$PERL -e "print 'start: \'abc';" >> three.y || exit 77]])
 
 AT_BISON_CHECK([three.y], [1], [],
 [[three.y:2.8-12: warning: extra characters in character literal [-Wother]
-three.y:3.8-4.0: warning: extra characters in character literal [-Wother]
 three.y:3.8-4.0: error: missing "'" at end of line
-three.y:4.8-11: warning: extra characters in character literal [-Wother]
+three.y:3.8-4.0: warning: extra characters in character literal [-Wother]
 three.y:4.8-11: error: missing "'" at end of file
+three.y:4.8-11: warning: extra characters in character literal [-Wother]
 ]])
 
 AT_CLEANUP
@@ -1639,7 +1628,7 @@ AT_CLEANUP
 ## %name-prefix and %define api.prefix are incompatible.  ##
 ## ------------------------------------------------------ ##
 
-AT_SETUP([[%name-prefix and %define api.prefix are incompatible]])
+AT_SETUP([[%name-prefix and api.prefix are incompatible]])
 
 # AT_TEST(DIRECTIVES, OPTIONS, ERROR-LOCATION)
 # --------------------------------------------