mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
examples: remove useless includes
* examples/c++/variant-11.yy, examples/c++/variant.yy: here. Fix warning when storing a long into an int.
This commit is contained in:
@@ -37,9 +37,8 @@
|
|||||||
|
|
||||||
%code // *.cc
|
%code // *.cc
|
||||||
{
|
{
|
||||||
#include <algorithm>
|
#include <climits> // INT_MIN, INT_MAX
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iterator>
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace yy
|
namespace yy
|
||||||
@@ -141,7 +140,10 @@ int
|
|||||||
main (int argc, const char *argv[])
|
main (int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
if (2 <= argc && isdigit (*argv[1]))
|
if (2 <= argc && isdigit (*argv[1]))
|
||||||
max = strtol (argv[1], nullptr, 10);
|
{
|
||||||
|
auto maxl = strtol (argv[1], nullptr, 10);
|
||||||
|
max = INT_MIN <= maxl && maxl <= INT_MAX ? int(maxl) : 4;
|
||||||
|
}
|
||||||
auto&& p = yy::parser{};
|
auto&& p = yy::parser{};
|
||||||
p.set_debug_level (!!getenv ("YYDEBUG"));
|
p.set_debug_level (!!getenv ("YYDEBUG"));
|
||||||
return p.parse ();
|
return p.parse ();
|
||||||
|
|||||||
@@ -33,9 +33,7 @@ typedef std::vector<std::string> strings_type;
|
|||||||
|
|
||||||
%code // *.cc
|
%code // *.cc
|
||||||
{
|
{
|
||||||
#include <algorithm>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iterator>
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace yy
|
namespace yy
|
||||||
|
|||||||
Reference in New Issue
Block a user