mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
c++: remove useless cast about yyeof_
Reported by Frank Heckenbach. https://lists.gnu.org/archive/html/bug-bison/2019-11/msg00016.html * data/skeletons/c++.m4 (b4_yytranslate_define): Don't use yyeof_ as if it had two different types. It is used once against the input argument, which is the value returned by yylex, which is an "external token number", typically an int. It is also used as output type, an "internal symbol number". It turns out that in both cases we mean "0", but let's keep yyeof_ only for the case "internal symbol number", i.e., _after_ conversion by yytranslate. This frees us from one cast.
This commit is contained in:
@@ -545,7 +545,7 @@ m4_define([b4_yytranslate_define],
|
||||
const int user_token_number_max_ = ]b4_user_token_number_max[;
|
||||
const token_number_type undef_token_ = ]b4_undef_token_number[;
|
||||
|
||||
if (static_cast<int> (t) <= yyeof_)
|
||||
if (t <= 0)
|
||||
return yyeof_;
|
||||
else if (static_cast<int> (t) <= user_token_number_max_)
|
||||
return translate_table[t];
|
||||
|
||||
Reference in New Issue
Block a user