Possible bug in scanner

David Balmain dbalm... at gmail.com
Sat Apr 19 09:34:28 UTC 2008


Hey folks,

I think I may have found a bug in the scanner. Not sure if this is the
best place to post bug reports but I couldn't find anywhere else on
the website.

Here's my machine definition. I've simplified it as much as possible;

%%{
    machine Word;

    main := |*
        'a' {PUTS("a: ");};
        [ab]+ . 'c' {PUTS("abc: ");};
        any;
    *|;
}%%

To run it, get the full code here;
    http://pastie.caboo.se/183409

Basically I'm running this with the string "ba a". What I'd expect to
happen is that the "[ab]+ . 'c'" expression would match 'ba' then fail
and then the "any" rule would consume the 'b' then 'a' would match
twice. Unfortunately, only the second 'a' matches.

If I run this with the string "ba" I get a segfault which also seems
to indicate a bug. Perhaps I'm just doing something wrong?

Cheers,



More information about the ragel-users mailing list