summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2019-11-30 16:52:48 +0100
committerAkim Demaille <akim.demaille@gmail.com>2019-11-30 17:30:48 +0100
commita4bf7cdf9ebd2250df98aadb907f31fc88a5434e (patch)
treeb9e05987d088b11e75b90934d3a84ae7b5366666
parent9471a5ffe95b519fe386a067513d65237253c582 (diff)
downloadbison-a4bf7cdf9ebd2250df98aadb907f31fc88a5434e.tar.gz
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.
-rw-r--r--data/skeletons/c++.m42
1 files changed, 1 insertions, 1 deletions
diff --git a/data/skeletons/c++.m4 b/data/skeletons/c++.m4
index fd021fd0..75b9e1b8 100644
--- a/data/skeletons/c++.m4
+++ b/data/skeletons/c++.m4
@@ -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];