Re: Error UTF-8 strings
Akim Demaille <[email protected]>
| Newsgroups | gmane.comp.parsers.bison.bugs |
|---|---|
| Message-ID | <[email protected]> |
hi Hans, > Le 23 juin 2020 à 15:42, Hans Åberg <[email protected]> a écrit : > > >> On 23 Jun 2020, at 07:47, Akim Demaille <[email protected]> wrote: >> >> give me a reproducible example. > > Here is the calc++ example from Bison 3.2.1, where I have changed the assignment symbol to "≔", and no other changes, compiled with Bison 3.6.3 using LC_CTYPE=UTF-8. In the yytname_, there is "≔": > "\"\\342\\211\\224\"" > > <calc++3.2.1.zip> Still no reproducible difference. As I said, nothing has changed here. You probably changed something in your environment. LC_ALL=UTF-8 $ for b in /usr/local/stow/bison-3.*/bin/bison do echo "------------ $b" LC_ALL=UTF-8 $b -o foo.c parser.yy && grep -F -A 5 'yytname_[] =' foo.c done ------------ /usr/local/stow/bison-3.0.5/bin/bison parser.yy:2.10-16: error: require bison 3.2.1, but have 3.0.5 %require "3.2.1" ^^^^^^^ ------------ /usr/local/stow/bison-3.2.4/bin/bison const parser::yytname_[] = { "\"end of file\"", "error", "$undefined", "\"\\342\\211\\224\"", "\"-\"", "\"+\"", "\"*\"", "\"/\"", "\"(\"", "\")\"", "\"identifier\"", "\"number\"", "$accept", "unit", "assignments", "assignment", "exp", YY_NULLPTR }; ------------ /usr/local/stow/bison-3.3.2/bin/bison const parser::yytname_[] = { "\"end of file\"", "error", "$undefined", "\"\\342\\211\\224\"", "\"-\"", "\"+\"", "\"*\"", "\"/\"", "\"(\"", "\")\"", "\"identifier\"", "\"number\"", "$accept", "unit", "assignments", "assignment", "exp", YY_NULLPTR }; ------------ /usr/local/stow/bison-3.4.2/bin/bison const parser::yytname_[] = { "\"end of file\"", "error", "$undefined", "\"\\342\\211\\224\"", "\"-\"", "\"+\"", "\"*\"", "\"/\"", "\"(\"", "\")\"", "\"identifier\"", "\"number\"", "$accept", "unit", "assignments", "assignment", "exp", YY_NULLPTR }; ------------ /usr/local/stow/bison-3.5.4/bin/bison const parser::yytname_[] = { "\"end of file\"", "error", "$undefined", "\"\\342\\211\\224\"", "\"-\"", "\"+\"", "\"*\"", "\"/\"", "\"(\"", "\")\"", "\"identifier\"", "\"number\"", "$accept", "unit", "assignments", "assignment", "exp", YY_NULLPTR }; ------------ /usr/local/stow/bison-3.6.4/bin/bison const parser::yytname_[] = { "\"end of file\"", "error", "\"invalid token\"", "\"\\342\\211\\224\"", "\"-\"", "\"+\"", "\"*\"", "\"/\"", "\"(\"", "\")\"", "\"identifier\"", "\"number\"", "$accept", "unit", "assignments", "assignment", "exp", YY_NULLPTR }; LC_ALL=fr_FR.UTF-8 $ for b in /usr/local/stow/bison-3.*/bin/bison do echo "------------ $b" LC_ALL=fr_FR.UTF-8 $b -o foo.c parser.yy && grep -F -A 5 'yytname_[] =' foo.c done ------------ /usr/local/stow/bison-3.0.5/bin/bison parser.yy:2.10-16: error: require bison 3.2.1, but have 3.0.5 %require "3.2.1" ^^^^^^^ ------------ /usr/local/stow/bison-3.2.4/bin/bison const parser::yytname_[] = { "\"end of file\"", "error", "$undefined", "\"≔\"", "\"-\"", "\"+\"", "\"*\"", "\"/\"", "\"(\"", "\")\"", "\"identifier\"", "\"number\"", "$accept", "unit", "assignments", "assignment", "exp", YY_NULLPTR }; ------------ /usr/local/stow/bison-3.3.2/bin/bison const parser::yytname_[] = { "\"end of file\"", "error", "$undefined", "\"≔\"", "\"-\"", "\"+\"", "\"*\"", "\"/\"", "\"(\"", "\")\"", "\"identifier\"", "\"number\"", "$accept", "unit", "assignments", "assignment", "exp", YY_NULLPTR }; ------------ /usr/local/stow/bison-3.4.2/bin/bison const parser::yytname_[] = { "\"end of file\"", "error", "$undefined", "\"≔\"", "\"-\"", "\"+\"", "\"*\"", "\"/\"", "\"(\"", "\")\"", "\"identifier\"", "\"number\"", "$accept", "unit", "assignments", "assignment", "exp", YY_NULLPTR }; ------------ /usr/local/stow/bison-3.5.4/bin/bison const parser::yytname_[] = { "\"end of file\"", "error", "$undefined", "\"≔\"", "\"-\"", "\"+\"", "\"*\"", "\"/\"", "\"(\"", "\")\"", "\"identifier\"", "\"number\"", "$accept", "unit", "assignments", "assignment", "exp", YY_NULLPTR }; ------------ /usr/local/stow/bison-3.6.4/bin/bison const parser::yytname_[] = { "\"end of file\"", "error", "\"invalid token\"", "\"≔\"", "\"-\"", "\"+\"", "\"*\"", "\"/\"", "\"(\"", "\")\"", "\"identifier\"", "\"number\"", "$accept", "unit", "assignments", "assignment", "exp", YY_NULLPTR };