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

Function try_parse_variable

src/engine/function.c:1981–2028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1979 */
1980
1981static int try_parse_variable( char const * * s_, char const * * string,
1982 VAR_PARSE_GROUP * out )
1983{
1984 char const * s = *s_;
1985 if ( s[ 0 ] == '$' && s[ 1 ] == '(' )
1986 {
1987 var_parse_group_maybe_add_constant( out, *string, s );
1988 s += 2;
1989 var_parse_group_add( out, parse_variable( &s ) );
1990 *string = s;
1991 *s_ = s;
1992 return 1;
1993 }
1994 if ( s[ 0 ] == '@' && s[ 1 ] == '(' )
1995 {
1996 int depth = 1;
1997 char const * ine;
1998 char const * split = 0;
1999 var_parse_group_maybe_add_constant( out, *string, s );
2000 s += 2;
2001 ine = s;
2002
2003 /* Scan the content of the response file @() section. */
2004 while ( *ine && ( depth > 0 ) )
2005 {
2006 switch ( *ine )
2007 {
2008 case '(': ++depth; break;
2009 case ')': --depth; break;
2010 case ':':
2011 if ( ( depth == 1 ) && ( ine[ 1 ] == 'E' ) && ( ine[ 2 ] == '='
2012 ) )
2013 split = ine;
2014 break;
2015 }
2016 ++ine;
2017 }
2018
2019 if ( !split || depth )
2020 return 0;
2021
2022 var_parse_group_add( out, parse_at_file( s, split, ine - 1 ) );
2023 *string = ine;
2024 *s_ = ine;
2025 return 1;
2026 }
2027 return 0;
2028}
2029
2030
2031static 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