java: tests: check location tracking in the calculator

Unfortunately in the Java skeleton the user cannot override the way
locations are displayed, and locations don't know the structure of the
positions.  So they cannot implement the tricks used in the C/C++
skeletons to display "1.1" instead of "1.1-1.2".

* tests/local.at (Java): Add support for column tracking in the
locations, as we did in examples/java/calc.
* tests/calc.at: Use AT_CALC_YYLEX.
This commit is contained in:
Akim Demaille
2020-02-02 09:19:40 +01:00
parent 3239866f4a
commit 2d97fe86fd
3 changed files with 123 additions and 116 deletions

10
TODO
View File

@@ -3,6 +3,16 @@
YYUNDEFTOK is an internal symbol number, as YYTERROR.
But YYERRCODE is an external token number.
** Tests
The calc.at test should call yyerror with location:
| exp '=' exp
{
if ($1.intValue () != $3.intValue ())
yyerror (]AT_LOCATION_IF([[@$, ]])["calc: error: " + $1 + " != " + $3);
}
** doc
I feel it's ugly to use the GNU style to declare functions in the doc. It
generates tons of white space in the page, and may contribute to bad page