mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
c++: minor changes
* data/lalr1.cc: Fix oldish comment. * data/stack.hh: Prefer typename for type names. Use size() instead of duplicating it. * examples/variant-11.yy, examples/variant.yy (yylex): Use int, as this is the type of the semantic value.
This commit is contained in:
@@ -124,10 +124,10 @@ namespace yy
|
||||
parser::symbol_type
|
||||
yylex ()
|
||||
{
|
||||
static auto count = 0u;
|
||||
const auto stage = count;
|
||||
static int count = 0;
|
||||
const int stage = count;
|
||||
++count;
|
||||
auto loc = parser::location_type{nullptr, stage + 1, stage + 1};
|
||||
auto loc = parser::location_type{nullptr, unsigned (stage + 1), unsigned (stage + 1)};
|
||||
if (stage == 0)
|
||||
return parser::make_TEXT (make_string_uptr ("I have numbers for you."), std::move (loc));
|
||||
else if (stage < max)
|
||||
|
||||
@@ -114,9 +114,10 @@ namespace yy
|
||||
parser::symbol_type
|
||||
yylex ()
|
||||
{
|
||||
static int stage = -1;
|
||||
++stage;
|
||||
parser::location_type loc (nullptr, stage + 1, stage + 1);
|
||||
static int count = 0;
|
||||
const int stage = count;
|
||||
++count;
|
||||
parser::location_type loc (nullptr, unsigned (stage + 1), unsigned (stage + 1));
|
||||
switch (stage)
|
||||
{
|
||||
case 0:
|
||||
|
||||
Reference in New Issue
Block a user