diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2020-05-03 08:17:05 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2020-05-03 09:20:08 +0200 |
commit | ccaa8e29f92170a92ef2d38128d122aec59e6dbe (patch) | |
tree | ebc87c93f5ad32a5bd8d1ac8cdced36daf0a988b /THANKS | |
parent | 76c3bccf405a2940bd891d95bcf92b182de6e5fa (diff) | |
download | bison-ccaa8e29f92170a92ef2d38128d122aec59e6dbe.tar.gz |
c++: provide backward compatibility on by_type
To write unit tests for their scanners, some users depended on
symbol_type::token():
Lexer lex("12345");
symbol_type t = lex.nextToken();
assert(t.token() == token::INTLIT);
assert(t.value.as<int>() == 12345);
But symbol_type::token() was removed in Bison 3.5 because it relied on
a conversion table. So users had to find other patterns, such as
assert(t.type_get() == by_type(token::INTLIT).type_get());
which relies on several private implementation details.
As part of transitioning from "token type" to "token kind", and making
this a public and documented interface, "by_type" was renamed
"by_kind" and "type_get()" was renamed as "kind()". The latter had
backward compatibility mechanisms, not the former.
In Bison 3.6 none of this should be used, but rather
assert(t.kind() == symbol_kind::S_INTLIT);
Reported by Pramod Kumbhar.
https://lists.gnu.org/r/bug-bison/2020-05/msg00012.html
* data/skeletons/c++.m4 (by_type): Make it an alias to by_kind.
Diffstat (limited to 'THANKS')
-rw-r--r-- | THANKS | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -155,6 +155,7 @@ Petr Machata pmachata@redhat.com Pho pho@cielonegro.org Piotr Gackiewicz gacek@intertel.com.pl Piotr MarciĆczyk piomar123@gmail.com +Pramod Kumbhar pramod.s.kumbhar@gmail.com Quentin Hocquet hocquet@gostai.com Quoc Peyrot chojin@lrde.epita.fr R Blake blakers@mac.com |