[ragel-users] Bug in Go language when using %%{ write first_final; }%%

Anton Ageev antage at gmail.com
Tue Nov 12 00:28:21 UTC 2013


Ragel defines constant "[machine name]_first_final" (where "[machine name]"
is a name specified in directive "machine [machine name]").

You could rewrite the code to use this constant:

%%{
  machine sdp;

// the machine definitions are here
....
}%%

...
// go code

if cs != sdp_first_final {
...
}




On Tue, Nov 12, 2013 at 3:57 AM, Iñaki Baz Castillo <ibc at aliax.net> wrote:

> The following code in Go:
>
> -----------------
>   if cs != %%{ write first_final; }%% {
> -----------------
>
> generates the following lines in the .go file:
>
> -----------------
>   if cs !=
> // line 12549 "SDP.go"
> 461
> // line 79 "SDP.rl"
>  {
> -----------------
>
> This produces, of course, a syntax error in Go:
>
> sdp/SDP.go:12549: missing condition in if statement
> sdp/SDP.go:12549: cs != 461 evaluated but not used
>
>
>
> $ ragel -v
> Ragel State Machine Compiler version 6.8 Feb 2013
>
>
>
> --
> Iñaki Baz Castillo
> <ibc at aliax.net>
>
> _______________________________________________
> ragel-users mailing list
> ragel-users at complang.org
> http://www.complang.org/mailman/listinfo/ragel-users




-- 
WBR, Anton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20131112/a5cbae2f/attachment-0001.html>
-------------- next part --------------
_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users


More information about the ragel-users mailing list