bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error UTF-8 strings


From: Akim Demaille
Subject: Re: Error UTF-8 strings
Date: Wed, 24 Jun 2020 07:27:34 +0200


> Le 23 juin 2020 à 11:12, Hans Åberg <haberg-1@telia.com> a écrit :
> 
> 
>> On 23 Jun 2020, at 07:47, Akim Demaille <akim@lrde.epita.fr> wrote:
>> 
>>> The question is if that helps, as it is the yytname_ that is translated 
>>> according to the LC_CTYPE environment variable.
>>> 
>>> This also introduces a locale dependency in the Bison compilation, so that 
>>> the generated parser no longer is platform independent.
>> 
>> Yes, that is indeed exactly what I meant: verbose is bad, and always was.
>> Use "detailed" instead.
> 
> From what I can see by comparing the outputs, UTF-8 is still converted, 
> though the writeout might be correct. With "verbose", I get in yytname_ an 
> entry
>  "\"\\342\\210\\216\""
> whereas with "detailed" in yy_sname
>  "\342\210\216"
> 
> An improvement if you are not supposed to read the parser source code.
> 
> The other errors occurred because I report errors in the grammar actions as:
>        throw syntax_error(@x, "Name " + $x.text + " already defined in this 
> scope as "
>          + yytnamerr_(yytname_[x0->first - 255]) + ".");
> 
> So perhaps you made some API for that?

yysymbol_name(x0->first).  If you need something else, you'll have to
read the doc about parse.error=custom.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]