[ragel-users] Bad code generation for C# ?

Denis Naumov alexander.me at gmail.com
Thu Mar 24 16:47:50 UTC 2011


Hi Adrian,

I found that Alphtype Statement probably not work for C#.

By default type is 'char'

and ragel generate
    static readonly char[] _test_trans_keys =  new ushort [] { '\u0022' .... }

for -T0 mode and

   switch( data[(      _ctx.current)] )
       {  case '\u0009': goto tr0;  ...  }

for -G0 mode

it's ok.

but if i use "alphtype byte;" ragel generate

    static readonly byte[] _test_trans_keys =  new ushort [] { '\u0022' .... }

for -T0 mode and

   switch( data[(      _ctx.current)] )
       {  case '\u0009': goto tr0;  ...  }

for -G0 mode

it's wrong. It must be
    static readonly byte[] _test_trans_keys =  new ushort [] { 22, .... }
and
   switch( data[(      _ctx.current)] )
       {  case 9: goto tr0;  ...  }

it seems to be that ragel generate '\u****' constants for all alphtypes.


Best regards,
Denis Naumov.

_______________________________________________
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