X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/746ee38c7cff93ad1fc97da6f06f124f394fb437..d521ee19f824305ac03a38cd52117f3a660a80b7:/tests/input.at diff --git a/tests/input.at b/tests/input.at index 71adf0b7..4eaa8df3 100644 --- a/tests/input.at +++ b/tests/input.at @@ -624,6 +624,10 @@ AT_DATA_GRAMMAR([input.y], %token WITHOUT_DASH "WITHOUT-DASH" %token WITH.PERIOD %token WITHOUT_PERIOD "WITHOUT.PERIOD" +%code { + void yyerror (char const *); + int yylex (void); +} %% start: with-dash without_dash with.period without_period; with-dash: WITH-DASH; @@ -636,13 +640,13 @@ without_period: "WITHOUT.PERIOD"; # POSIX Yacc accept periods, but not dashes. AT_BISON_CHECK([--yacc input.y], [1], [], [[input.y:9.8-16: POSIX Yacc forbids dashes in symbol names: WITH-DASH -input.y:14.8-16: POSIX Yacc forbids dashes in symbol names: with-dash +input.y:18.8-16: POSIX Yacc forbids dashes in symbol names: with-dash ]]) # So warn about them. AT_BISON_CHECK([-Wyacc input.y], [], [], [[input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH -input.y:14.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash +input.y:18.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash ]]) # Dashes are fine for GNU Bison. @@ -921,38 +925,36 @@ AT_BISON_CHECK([[Input.y]], [1], [], AT_CLEANUP -## ----------------------------------------- ## -## %define lr.default_rules invalid values. ## -## ----------------------------------------- ## +## ------------------------ ## +## %define enum variables. ## +## ------------------------ ## -AT_SETUP([[%define lr.default_rules invalid values]]) +AT_SETUP([[%define enum variables]]) +# Front-end. AT_DATA([[input.y]], -[[%define lr.default_rules "bogus" +[[%define lr.default_reductions "bogus" %% start: ; ]]) - AT_BISON_CHECK([[input.y]], [[1]], [[]], -[[input.y:1.9-24: invalid value for %define variable `lr.default_rules': `bogus' +[[input.y:1.9-29: invalid value for %define variable `lr.default_reductions': `bogus' +input.y:1.9-29: accepted value: `all' +input.y:1.9-29: accepted value: `consistent' +input.y:1.9-29: accepted value: `accepting' ]]) -AT_CLEANUP - -## ------------------------ ## -## %define enum variables. ## -## ------------------------ ## - -AT_SETUP([[%define enum variables]]) - +# Back-end. AT_DATA([[input.y]], [[%define api.push_pull "neither" %% start: ; ]]) - AT_BISON_CHECK([[input.y]], [1], [], [[input.y:1.9-21: 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_CLEANUP