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

Function try_parse_variable

src/engine/function.cpp:2179–2212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2177 */
2178
2179static int32_t try_parse_variable( char const * * s_, char const * * string,
2180 VAR_PARSE_GROUP * out )
2181{
2182 char const * s = *s_;
2183 if ( s[ 0 ] == '$' && s[ 1 ] == '(' )
2184 {
2185 var_parse_group_maybe_add_constant( out, *string, s );
2186 s += 2;
2187 var_parse_group_add( out, parse_variable( &s ) );
2188 *string = s;
2189 *s_ = s;
2190 return 1;
2191 }
2192 if ( s[ 0 ] == '@' && s[ 1 ] == '(' )
2193 {
2194 var_parse_group_maybe_add_constant( out, *string, s );
2195 s += 2;
2196 VAR_PARSE_VAR *vp = (VAR_PARSE_VAR*)parse_variable( &s );
2197 /* We at least need the empty (:E) modifier. */
2198 if (var_parse_var_mod_index(vp, 'E') >= 0)
2199 {
2200 vp->base.type = VAR_PARSE_TYPE_FILE;
2201 var_parse_group_add( out, (VAR_PARSE*)vp );
2202 *string = s;
2203 *s_ = s;
2204 return 1;
2205 }
2206 else
2207 {
2208 var_parse_var_free( vp );
2209 }
2210 }
2211 return 0;
2212}
2213
2214
2215static char const * current_file = "";

Callers 4

parse_expansionFunction · 0.85
parse_variableFunction · 0.85
parse_var_stringFunction · 0.85
balance_parenthesesFunction · 0.85

Calls 5

var_parse_group_addFunction · 0.85
parse_variableFunction · 0.85
var_parse_var_mod_indexFunction · 0.85
var_parse_var_freeFunction · 0.85

Tested by

no test coverage detected