summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorAkim Demaille <akim@lrde.epita.fr>2012-07-14 10:01:40 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-07-14 12:10:22 +0200
commit9a6a600138d30d36e02d186625cc3932d4624aec (patch)
tree2fa6d3064287b1c72744ec34c7816d905161e169 /t
parent9404f529bc178d75ee8003853e1fa67281cd080d (diff)
downloadautomake-9a6a600138d30d36e02d186625cc3932d4624aec.tar.gz
tests: upgrade and fix Bison test case
* t/yacc-bison-skeleton-cxx.sh: Request locations, to be even more stressful. Use %union to make sure the %{...%} is inserted where appropriate. Fix some indentation/coding style issues.
Diffstat (limited to 't')
-rwxr-xr-xt/yacc-bison-skeleton-cxx.sh20
1 files changed, 12 insertions, 8 deletions
diff --git a/t/yacc-bison-skeleton-cxx.sh b/t/yacc-bison-skeleton-cxx.sh
index 609ebc24e..a02a25a8c 100755
--- a/t/yacc-bison-skeleton-cxx.sh
+++ b/t/yacc-bison-skeleton-cxx.sh
@@ -40,10 +40,15 @@ END
cat > zardoz.yy << 'END'
%skeleton "lalr1.cc"
%defines
+%locations
+%union
+{
+ int ival;
+};
%{
-#define YYSTYPE int
-int yylex(YYSTYPE* yylval_param);
+int yylex (yy::parser::semantic_type *yylval,
+ yy::parser::location_type *yylloc);
%}
%%
@@ -51,23 +56,22 @@ start : /* empty */
%%
int
-yylex(YYSTYPE*)
+yylex (yy::parser::semantic_type *yylval,
+ yy::parser::location_type *yylloc)
{
- return 0;
+ return 0;
}
void
-yy::parser::error(const yy::parser::location_type&, const std::string& m)
+yy::parser::error(const yy::parser::location_type&, const std::string&)
{
- return;
+ return;
}
END
cat > foo.cc << 'END'
#include "zardoz.hh"
-using namespace std;
-
int
main(int argc, char** argv)
{