[ragel-users] [newbie] eof actions never executed...
gaspard at teti.ch
Wed Dec 3 15:24:49 UTC 2008
I changed the 'main' to include the end of buffer character and it works.
main := ws* (string %string | number %number | hash %hash) '\0';
By the way, many thanks for your great software. As soon as rubyk
(http://rubyk.org) gets back on its feets, I will let you know of what
I'm doing with ragel (the Turing object might be fun...).
On Wed, Dec 3, 2008 at 3:59 PM, Adrian Thurston <thurston at complang.org> wrote:
> Leaving actions are always executed on a following character (one char
> of lookahead) so either there needs to be something after the number or
> you need to set eof = pe to induce the action.
> Gaspard Bucher wrote:
>> Hi there !
>> This might look like a silly question.
>> I cannot seem to get this right: parse "1.24"
>> real = ([\-+]? $num_a ('0'..'9' digit* '.' digit+) $num_a );
>> integer = ([\-+]? $num_a ('0'..'9' digit*) $num_a );
>> number = real | integer;
>> main := ws* (string %string | number %number | hash %hash);
>> %number is never executed...
>> If I use @number, it is called several times.
>> I sure am missing something...
>> Thanks for your help.
>> ragel-users mailing list
>> ragel-users at complang.org
> ragel-users mailing list
> ragel-users at complang.org
More information about the ragel-users