tests: handle locations in the generic yyerror functions.

* tests/local.at (AT_YYERROR_DECLARE_EXTERN, AT_YYERROR_DECLARE)
(AT_YYERROR_DEFINE): Handle locations for C and C++.
* tests/calc.at: Use it for C++ (as C has extra arguments which
are not yet handled by AT_BISON_OPTION_PUSHDEFS).
* tests/actions.at: Adjust.
This commit is contained in:
Akim Demaille
2012-06-22 10:20:28 +02:00
parent eb46d61f4d
commit 7490994123
3 changed files with 20 additions and 15 deletions

View File

@@ -376,15 +376,7 @@ power (int base, int exponent)
return o;
}
]])
/* A C++ error reporting function. */
void
AT_NAME_PREFIX::parser::error (const location_type& l, const std::string& m)
{
(void) l;
std::cerr << AT_LOCATION_IF([l << ": " << ])m << std::endl;
}
],
AT_YYERROR_DEFINE],
[/* A C error reporting function. */
static void
yyerror (AT_YYERROR_ARG_LOC_IF([YYLTYPE *llocp, ])