[ragel-users] 0x0E..0xFF produces "lower end of range is greater then upper end"

Adrian Thurston thurston at complang.org
Sun Nov 24 19:32:45 UTC 2013

You've got it. Just use unsigned char. The breakdown you specified 
avoids a range (pos ... neg).

I asked about the architecture in case you're on an architecture where 
char is unsigned by default. There is a bug in that case.

On 13-10-25 11:39 AM, Iñaki Baz Castillo wrote:
> 2013/10/21 Jan Kundrát <jkt at flaska.net>:
>> On Monday, 21 October 2013 17:17:57 CEST, Iñaki Baz Castillo wrote:
>>> The following modification in the grammar fixes it:
>>>    ( 0x01..0x09 | 0x0B..0x0C | 0x0E..0x7F | 0x80..0xFF)+;
>>> but I don't understand wht it is required to split the last range into
>>> two ranges.
>> Seems like ragel treats this as a signed char, i.e. -128..127. Your code
>> appears to be a nice and portable workaround.
> I've realized that setting:
>    alphtype unsigned char;
> or
>    alphtype unsigned int;
> also fixes the problem. Section 5.2 of the doc says that "The default
> is char for all languages except Go where the default is byte" so it
> makes sense.
> Thanks a lot.

ragel-users mailing list
ragel-users at complang.org

More information about the ragel-users mailing list