tests: don't require locations uselessly.

* tests/c++.at (Syntax error discarding no lookahead): Contrary to
	2.5, C++ parsers can work without locations.
This commit is contained in:
Akim Demaille
2012-02-09 10:04:32 +01:00
parent 9bfbf75bdf
commit a8c5aaa53e

View File

@@ -385,12 +385,11 @@ AT_DATA_GRAMMAR([[input.yy]],
%code { %code {
#include <string> #include <string>
int yylex (yy::parser::semantic_type *, yy::location *); int yylex (yy::parser::semantic_type *);
#define USE(Args) #define USE(Args)
} }
%defines %defines
%locations
%define parse.error verbose %define parse.error verbose
%nonassoc 'a' ; %nonassoc 'a' ;
@@ -420,14 +419,14 @@ start: 'b' consistent-error ;
%% %%
int int
yylex (yy::parser::semantic_type *, yy::location *) yylex (yy::parser::semantic_type *)
{ {
static char const *input = "aa"; static char const *input = "aa";
return *input++; return *input++;
} }
void void
yy::parser::error (const location_type &, const std::string &m) yy::parser::error (const std::string &m)
{ {
std::cerr << m << std::endl; std::cerr << m << std::endl;
} }