Hi Laurent,

The te variable points (indexes) one past the end of the token buffer. This is true in all languages. To use it in a ruby array index you need to subtract 1.

Regards,
 Adrian

On 14-05-12 10:10 AM, Laurent Laborde wrote:
Friendly greetings !

I'm trying to use ragel with ruby as target but i have a problem that
drive me crazy since many days.

Here is the code : https://gist.github.com/ker2x/a86b1f6fc0de6a9c1f2e

and the output

[{:type=>:NUMBER, :name=>"+1 "}, {:type=>:SPACE, :name=>" 2"},
{:type=>:NUMBER, :name=>"2 "}, {:type=>:SPACE, :name=>" -"},
{:type=>:NUMBER, :name=>"-3 "}, {:type=>:SPACE, :name=>" 4"},
{:type=>:NUMBER, :name=>"4 "}, {:type=>:SPACE, :name=>" p"}]

there is an extra char everywhere.
Somehow, with this simplified version, it works when catching "print".
On a bigger version (that recognize string) i have to do "print " (with
an extra space)

What's happening ?
Thank you very much.

(i asked on irc for a few days but it's idle)



--
Laurent "ker2x" Laborde
Bigdata hacker @ Ebuzzing


_______________________________________________
ragel-users mailing list
ragel-users@complang.org
http://www.complang.org/mailman/listinfo/ragel-users


_______________________________________________
ragel-users mailing list
ragel-users@complang.org
http://www.complang.org/mailman/listinfo/ragel-users

Reply via email to