| 959 | } |
| 960 | |
| 961 | static LIST * apply_subscript( STACK * s ) |
| 962 | { |
| 963 | LIST * value = stack_top( s ); |
| 964 | LIST * indices = stack_at( s, 1 ); |
| 965 | LIST * result = L0; |
| 966 | int length = list_length( value ); |
| 967 | string buf[ 1 ]; |
| 968 | LISTITER indices_iter = list_begin( indices ); |
| 969 | LISTITER const indices_end = list_end( indices ); |
| 970 | string_new( buf ); |
| 971 | for ( ; indices_iter != indices_end; indices_iter = list_next( indices_iter |
| 972 | ) ) |
| 973 | { |
| 974 | LISTITER iter = list_begin( value ); |
| 975 | LISTITER end = list_end( value ); |
| 976 | subscript_t const subscript = parse_subscript( object_str( list_item( |
| 977 | indices_iter ) ) ); |
| 978 | get_iters( subscript, &iter, &end, length ); |
| 979 | for ( ; iter != end; iter = list_next( iter ) ) |
| 980 | result = list_push_back( result, object_copy( list_item( iter ) ) ); |
| 981 | } |
| 982 | string_free( buf ); |
| 983 | return result; |
| 984 | } |
| 985 | |
| 986 | |
| 987 | /* |
no test coverage detected