diff options
Diffstat (limited to 'test/rlhc.d/case/rust1.rs-U-F0--var-backend.in')
-rw-r--r-- | test/rlhc.d/case/rust1.rs-U-F0--var-backend.in | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/test/rlhc.d/case/rust1.rs-U-F0--var-backend.in b/test/rlhc.d/case/rust1.rs-U-F0--var-backend.in new file mode 100644 index 00000000..8a31434b --- /dev/null +++ b/test/rlhc.d/case/rust1.rs-U-F0--var-backend.in @@ -0,0 +1,131 @@ +host( "working/rust1.rl", 1 ) @{// + // @@LANG: rust + // + + + +}@ +array s8 _atoi_actions( 0, 1 ) = { 0, 1, 0, 0 }; + +array u8 _atoi_trans_keys( 0, 3 ) = { 1, 0, 0, 3, 3, 3, 1, 3, 1, 0, 0 }; + +array s8 _atoi_char_class( 0, 3 ) = { 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0 }; + +array s8 _atoi_index_offsets( 0, 8 ) = { 0, 0, 4, 5, 8, 0 }; + +array s8 _atoi_indicies( 0, 3 ) = { 0, 1, 1, 2, 2, 3, 1, 2, 0 }; + +array s8 _atoi_index_defaults( 0, 1 ) = { 0, 1, 1, 1, 1, 0 }; + +array s8 _atoi_trans_cond_spaces( -1, 0 ) = { -1, -1, -1, -1, 0 }; + +array s8 _atoi_cond_targs( 0, 4 ) = { 2, 0, 3, 4, 0 }; + +array s8 _atoi_cond_actions( 0, 1 ) = { 0, 0, 0, 1, 0 }; + +array s8 _atoi_nfa_targs( 0, 0 ) = { 0, 0 }; + +array s8 _atoi_nfa_offsets( 0, 0 ) = { 0, 0, 0, 0, 0, 0 }; + +array s8 _atoi_nfa_push_actions( 0, 0 ) = { 0, 0 }; + +array s8 _atoi_nfa_pop_trans( 0, 0 ) = { 0, 0 }; + +value int atoi_start = 1; +value int atoi_first_final = 4; +value int atoi_error = 0; + +value int atoi_en_main = 1; + +host( "working/rust1.rl", 14 ) @{ + + fn m( s: String ) + { + let data: &[u8] = s.as_bytes(); + let mut p = 0; + let mut pe = s.len(); + let mut cs: i32 = 0; + + }@ + { + cs = cast(int)atoi_start; + } + host( "working/rust1.rl", 23 ) @{ + }@ + { + uint _trans = 0; + uint _have = 0; + uint _cont = 1; + index s8 _acts; + uint _nacts; + index u8 _keys; + index s8 _inds; + while ( _cont == 1 ) { + + if ( cs == 0 ) + _cont = 0; + _have = 0; + if ( p == pe ) { + if ( _have == 0 ) + _cont = 0; + } + if ( _cont == 1 ) { + if ( _have == 0 ) { + _keys = offset( _atoi_trans_keys, (cs<<1) ); + _inds = offset( _atoi_indicies, _atoi_index_offsets[cs] ); + + if ( ( deref( data, p )) <= 57 && ( deref( data, p )) >= 45 ) + { + int _ic = cast(int)_atoi_char_class[cast(int)( deref( data, p )) - 45]; + if ( _ic <= cast(int)deref( _atoi_trans_keys, _keys+1 ) && _ic >= cast(int)deref( _atoi_trans_keys, _keys ) ) + _trans = cast(uint)deref( _atoi_indicies, _inds + cast(int)( _ic - cast(int)deref( _atoi_trans_keys, _keys ) ) ); + else + _trans = cast(uint)_atoi_index_defaults[cs]; + } + else { + _trans = cast(uint)_atoi_index_defaults[cs]; + } + + } + if ( _cont == 1 ) { + cs = cast(int)_atoi_cond_targs[_trans]; + + if ( _atoi_cond_actions[_trans] != 0 ) { + _acts = offset( _atoi_actions, _atoi_cond_actions[_trans] ); + _nacts = cast(uint)deref( _atoi_actions, _acts ); + _acts += 1; + while ( _nacts > 0 ) + { + switch ( deref( _atoi_actions, _acts ) ) + { + case 0 { + host( "working/rust1.rl", 8 ) ${ + println!( "match" ); + }$ + } + } + _nacts -= 1; + _acts += 1; + } + } + + if ( cs == 0 ) + _cont = 0; + if ( _cont == 1 ) + p += 1; + + }} + } + } + host( "working/rust1.rl", 24 ) @{ + } + + fn main() + { + m( "-99.".to_string() ); + m( "100.".to_string() ); + m( "100x.".to_string() ); + m( "1000.".to_string() ); + } + +}@
\ No newline at end of file |