tests: add missing includes

* tests/actions.at, tests/c++.at, tests/headers.at,
* tests/regression.at: here.
This commit is contained in:
Akim Demaille
2019-10-10 07:00:11 +02:00
parent 602d562d6f
commit 7d47d51962
4 changed files with 9 additions and 2 deletions

View File

@@ -425,6 +425,7 @@ AT_DATA_GRAMMAR([[input.y]],
]$3[ ]$3[
%code %code
{ {
#include <stdio.h> /* putchar. */
]AT_YYERROR_DECLARE[ ]AT_YYERROR_DECLARE[
]AT_YYLEX_DECLARE[ ]AT_YYLEX_DECLARE[
} }
@@ -1728,6 +1729,7 @@ AT_DATA_GRAMMAR([[input.y]],
# define YYSTYPE sem_type # define YYSTYPE sem_type
]AT_CXX_IF([[ ]AT_CXX_IF([[
# include <cstdio> // EOF.
# include <iostream> # include <iostream>
namespace namespace
{ {

View File

@@ -988,7 +988,8 @@ yy::parser::error (const std::string &m)
# Another file to check syntax_error's linkage. # Another file to check syntax_error's linkage.
AT_DATA_SOURCE([scan.cc], AT_DATA_SOURCE([scan.cc],
[[#include "input.hh" [[#include <cstdio> // getchar
#include "input.hh"
// 'a': valid item, 's': syntax error, 'l': lexical error. // 'a': valid item, 's': syntax error, 'l': lexical error.
int int

View File

@@ -127,6 +127,7 @@ AT_DATA_GRAMMAR([input.y],
%define parse.error verbose %define parse.error verbose
]AT_VARIANT_IF([%token <int> 'x'], [%union {int integer;}])[ ]AT_VARIANT_IF([%token <int> 'x'], [%union {int integer;}])[
%code { %code {
#include <stdio.h> /* printf. */
]AT_PUSH_IF([[ ]AT_PUSH_IF([[
#if defined __GNUC__ && 7 == __GNUC__ #if defined __GNUC__ && 7 == __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" # pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
@@ -212,6 +213,7 @@ $2
int integer; int integer;
} }
%{ %{
#include <stdio.h> /* printf. */
]AT_PUSH_IF([[ ]AT_PUSH_IF([[
#if defined __GNUC__ && 7 == __GNUC__ #if defined __GNUC__ && 7 == __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" # pragma GCC diagnostic ignored "-Wmaybe-uninitialized"

View File

@@ -1309,6 +1309,7 @@ AT_BISON_OPTION_PUSHDEFS([%debug $1])
AT_DATA_GRAMMAR([input.y], AT_DATA_GRAMMAR([input.y],
[[%code { [[%code {
#include <stdio.h> /* printf */
]AT_YYERROR_DECLARE[ ]AT_YYERROR_DECLARE[
]AT_YYLEX_DECLARE[ ]AT_YYLEX_DECLARE[
} }
@@ -1480,12 +1481,13 @@ AT_DATA_GRAMMAR([input.y],
} }
%{ %{
#include <stdio.h> /* printf. */
]AT_YYERROR_DECLARE[ ]AT_YYERROR_DECLARE[
]AT_YYLEX_DECLARE[ ]AT_YYLEX_DECLARE[
%} %}
%% %%
exp: 'a' { fprintf (stdout, "x: %d, y: %d\n", x, y); }; exp: 'a' { printf ("x: %d, y: %d\n", x, y); };
%% %%
]AT_YYERROR_DEFINE[ ]AT_YYERROR_DEFINE[
]AT_YYLEX_DEFINE(["a"])[ ]AT_YYLEX_DEFINE(["a"])[