MCPcopy Create free account
hub / github.com/boostorg/build / apply_subscript

Function apply_subscript

src/engine/function.c:920–943  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

918}
919
920static LIST * apply_subscript( STACK * s )
921{
922 LIST * value = stack_top( s );
923 LIST * indices = stack_at( s, 1 );
924 LIST * result = L0;
925 int length = list_length( value );
926 string buf[ 1 ];
927 LISTITER indices_iter = list_begin( indices );
928 LISTITER const indices_end = list_end( indices );
929 string_new( buf );
930 for ( ; indices_iter != indices_end; indices_iter = list_next( indices_iter
931 ) )
932 {
933 LISTITER iter = list_begin( value );
934 LISTITER end = list_end( value );
935 subscript_t const subscript = parse_subscript( object_str( list_item(
936 indices_iter ) ) );
937 get_iters( subscript, &iter, &end, length );
938 for ( ; iter != end; iter = list_next( iter ) )
939 result = list_push_back( result, object_copy( list_item( iter ) ) );
940 }
941 string_free( buf );
942 return result;
943}
944
945
946/*

Callers 1

function_runFunction · 0.85

Calls 12

stack_topFunction · 0.85
stack_atFunction · 0.85
list_lengthFunction · 0.85
list_beginFunction · 0.85
list_endFunction · 0.85
string_newFunction · 0.85
parse_subscriptFunction · 0.85
object_strFunction · 0.85
get_itersFunction · 0.85
list_push_backFunction · 0.85
object_copyFunction · 0.85
string_freeFunction · 0.85

Tested by

no test coverage detected