From: Akim Demaille Date: Sat, 3 Nov 2012 16:15:43 +0000 (+0100) Subject: tests: fix locations in C X-Git-Tag: v2.6.5~16 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/7dbb8d8aba43ba020cb2d8f580e01997b8dbc875 tests: fix locations in C * tests/local.at (AT_YYERROR_DEFINE): Don't display the end of the location if it is not after its beginning. * tests/actions.at, tests/cxx-type.at: Adjust the expected output. --- diff --git a/tests/actions.at b/tests/actions.at index b2d5e9d1..2314c1cd 100644 --- a/tests/actions.at +++ b/tests/actions.at @@ -664,7 +664,7 @@ Reading a token: Next token is token 'd' (1.4-1.4: <> printer for 'd' @ 4) Shifting token 'd' (1.4-1.4: <> printer for 'd' @ 4) Entering state 6 Reading a token: Now at end of input. -1.5-4: syntax error, unexpected $end, expecting 'e' +1.5: syntax error, unexpected $end, expecting 'e' Error: popping token 'd' (1.4-1.4: <> printer for 'd' @ 4) Stack now 0 1 3 5 Error: popping token 'c' (1.3-1.3: 'b'/'c' printer for 'c' @ 3) diff --git a/tests/cxx-type.at b/tests/cxx-type.at index f5e7c559..b0e5fdcd 100644 --- a/tests/cxx-type.at +++ b/tests/cxx-type.at @@ -376,7 +376,7 @@ m4_define([_AT_GLR_STDERR], ]]) m4_define([_AT_GLR_STDERR_WITH_LOC], -[[17.5-4: syntax error +[[17.5: syntax error ]]) m4_define([_AT_VERBOSE_GLR_STDERR], @@ -384,7 +384,7 @@ m4_define([_AT_VERBOSE_GLR_STDERR], ]]) m4_define([_AT_VERBOSE_GLR_STDERR_WITH_LOC], -[[17.5-4: syntax error, unexpected ID, expecting '=' or '+' or ')' +[[17.5: syntax error, unexpected ID, expecting '=' or '+' or ')' ]]) ## ---------------------------------------------------- ## diff --git a/tests/local.at b/tests/local.at index b0ec647f..2af7971b 100644 --- a/tests/local.at +++ b/tests/local.at @@ -388,10 +388,10 @@ static AT_YYERROR_SEES_LOC_IF([[ fprintf (stderr, "%d.%d", ]AT_LOC_FIRST_LINE[, ]AT_LOC_FIRST_COLUMN[); - if (]AT_LOC_FIRST_LINE[ != ]AT_LOC_LAST_LINE[) + if (]AT_LOC_FIRST_LINE[ < ]AT_LOC_LAST_LINE[) fprintf (stderr, "-%d.%d", ]AT_LOC_LAST_LINE[, ]AT_LOC_LAST_COLUMN[ - 1); - else if (]AT_LOC_FIRST_COLUMN[ != ]AT_LOC_LAST_COLUMN[ - 1) + else if (]AT_LOC_FIRST_COLUMN[ < ]AT_LOC_LAST_COLUMN[ - 1) fprintf (stderr, "-%d", ]AT_LOC_LAST_COLUMN[ - 1); fprintf (stderr, ": ");]])[