Discussion:
[ragel-users] Scanners (Section 6.3) code example broken
Ryan Bigg
2012-11-19 22:09:24 UTC
Permalink
Section 6.3's second code example is this:

word = [a-z]+;
head_name = ?Header?;
header := |*
word;
? ?;
?\n? => { fret; };
*|;
main := ( head_name ?:? @{ fcall header; } )*;

The guide doesn't say, but I assume we use it in this fashion:

%%{
machine example;
word = [a-z]+;
head_name = ?Header?;
header := |*
word;
? ?;
?\n? => { fret; };
*|;
main := ( head_name ?:? @{ fcall header; } )*;
}%%


When I try this and run `ragel` over it, it produces these errors:

email3.rl:4:18: graph lookup of "Header" failed
email3.rl:7:10: at token ";": parse error

Is it my fault, or is the documentation wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.complang.org/pipermail/ragel-users/attachments/20121120/ce557634/attachment.html>
Adrian Thurston
2012-12-09 17:08:55 UTC
Permalink
I think there is a copy-paste error. The quotes have not translated to
something legal WRT ragel syntax.

-Adrian
Post by Ryan Bigg
word = [a-z]+;
head_name = ?Header?;
header := |*
word;
? ?;
?\n? => { fret; };
*|;
%%{
machine example;
word = [a-z]+;
head_name = ?Header?;
header := |*
word;
? ?;
?\n? => { fret; };
*|;
}%%
email3.rl:4:18: graph lookup of "Header" failed
email3.rl:7:10: at token ";": parse error
Is it my fault, or is the documentation wrong?
_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users
Loading...