[ragel-users] D backend seems not working
Gabriel Laskar
gabriel at lse.epita.fr
Thu Oct 28 17:03:24 UTC 2010
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%
--
Gabriel Laskar <gabriel at lse.epita.fr>
_______________________________________________
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