[ragel-users] D backend seems not working

Adrian Thurston adrian.thurston at esentire.com
Thu Oct 28 21:20:46 UTC 2010


Hi, yes it looks like the D examples and the code generator are dated. 
They were tested with GDC 0.13 or 0.14. I have not personally used them 
in several years.

-Adrian

On 10-10-28 10:03 AM, Gabriel Laskar wrote:
> Hi,
>
> I want to use ragel for a project I have in D. But generated code
> doesn't compile. I have tried to run the test suite, needed to make
> small modifications to use dmd as a D compiler (the variable was not
> even set), no tests seems to work also.
>
> Is is a known issue ?
>
> here is the code I have tried and the compilation errors :
>
> ~/ragel% cat test.rl
>
> %%{
>    machine foo;
>
>    main :=
>      ('foo' | 'bar')
>      0 @{ res = 1; };
> }%%
>
> %% write data;
>
> int main(string[] args)
> {
>    int cs;
>    int res = 0;
>
>    if (args.length>  1)
>    {
>      char *p = args[1];
>      char *pe = p + args[1].length;
>      %% write init;
>      %% write exec;
>    }
>
>    return res;
> }
> ~/ragel% ragel -D test.rl
> ~/ragel% dmd test.d
> test.rl(19): Error: cannot implicitly convert expression (args[1u]) of
> type string to char*
> test.d(83): Error: cannot implicitly convert expression
> (&_foo_trans_keys[cast(uint)_foo_key_offsets[cast(uint)cs]]) of type
> const(char)* to char*
> test.d(137): Error: cannot implicitly convert expression
> (&_foo_actions[cast(uint)_foo_trans_actions[_trans]]) of type
> const(byte)* to byte*
> 1:~/ragel%
>
>

_______________________________________________
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