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 <[email protected]>

_______________________________________________
ragel-users mailing list
[email protected]
http://www.complang.org/mailman/listinfo/ragel-users

Reply via email to