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

Function try_parse_variable

v2/engine/function.c:1930–1977  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1928 */
1929
1930static int try_parse_variable( char const * * s_, char const * * string,
1931 VAR_PARSE_GROUP * out )
1932{
1933 char const * s = *s_;
1934 if ( s[ 0 ] == '$' && s[ 1 ] == '(' )
1935 {
1936 var_parse_group_maybe_add_constant( out, *string, s );
1937 s += 2;
1938 var_parse_group_add( out, parse_variable( &s ) );
1939 *string = s;
1940 *s_ = s;
1941 return 1;
1942 }
1943 if ( s[ 0 ] == '@' && s[ 1 ] == '(' )
1944 {
1945 int depth = 1;
1946 char const * ine;
1947 char const * split = 0;
1948 var_parse_group_maybe_add_constant( out, *string, s );
1949 s += 2;
1950 ine = s;
1951
1952 /* Scan the content of the response file @() section. */
1953 while ( *ine && ( depth > 0 ) )
1954 {
1955 switch ( *ine )
1956 {
1957 case '(': ++depth; break;
1958 case ')': --depth; break;
1959 case ':':
1960 if ( ( depth == 1 ) && ( ine[ 1 ] == 'E' ) && ( ine[ 2 ] == '='
1961 ) )
1962 split = ine;
1963 break;
1964 }
1965 ++ine;
1966 }
1967
1968 if ( !split || depth )
1969 return 0;
1970
1971 var_parse_group_add( out, parse_at_file( s, split, ine - 1 ) );
1972 *string = ine;
1973 *s_ = ine;
1974 return 1;
1975 }
1976 return 0;
1977}
1978
1979
1980static char const * current_file = "";

Callers 4

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

Calls 4

var_parse_group_addFunction · 0.85
parse_variableFunction · 0.85
parse_at_fileFunction · 0.85

Tested by

no test coverage detected