From ccaa8e29f92170a92ef2d38128d122aec59e6dbe Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 3 May 2020 08:17:05 +0200 Subject: 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() == 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. --- THANKS | 1 + 1 file changed, 1 insertion(+) (limited to 'THANKS') diff --git a/THANKS b/THANKS index 157efc00..805c744f 100644 --- a/THANKS +++ b/THANKS @@ -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 -- cgit v1.2.1