d: track locations

* configure.ac (DCFLAGS): Pass -g.
* data/skeletons/d.m4 (b4_locations_if): Remove, let bison.m4's one do
its job.
* data/skeletons/lalr1.d (position): Leave filename empty by default.
(position::toString): Don't print empty file names.
(location::this): New ctor.
(location::toString): Match the implementations of C/C++.
(yy_semantic_null): Leave undefined, the previous implementation does
not compile.
* tests/calc.at: Improve the implementation for D.
Enable more checks, in particular using locations.
* tests/local.at (AT_YYERROR_DEFINE(d)): Fix its implementation.
This commit is contained in:
Akim Demaille
2019-06-21 08:27:27 +02:00
parent f26bd45da3
commit 0984f70e08
5 changed files with 70 additions and 31 deletions

View File

@@ -672,10 +672,9 @@ m4_define([AT_YYERROR_DECLARE_EXTERN(d)], [])
m4_define([AT_YYERROR_DEFINE(d)],
[[/* An error reporting function. */
public void error (]AT_LOCATION_IF([[location_type l, ]])[string m)
public void yyerror (]AT_LOCATION_IF([[YYLocation l, ]])[string m)
{
// FIXME: location.
stderr.writeln (m);
stderr.writeln (]AT_LOCATION_IF([[l, ": ", ]])[m);
}]])