diff options
author | Brad King <brad.king@kitware.com> | 2008-12-17 13:24:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-12-17 13:24:35 (GMT) |
commit | 625ef26163451686a68b092d672e79c3e2b80e1e (patch) | |
tree | caf361740e62c2e9e727d13f84bb7dc21be59545 /Source/cmCommandArgumentParser.y | |
parent | 093cfc22f11ab014abe220e600e2d99c7a356851 (diff) | |
download | CMake-625ef26163451686a68b092d672e79c3e2b80e1e.zip CMake-625ef26163451686a68b092d672e79c3e2b80e1e.tar.gz CMake-625ef26163451686a68b092d672e79c3e2b80e1e.tar.bz2 |
ENH: Allow most characters in ENV variable refs
The $ENV{VAR} syntax permits access to environment variables. This
teaches CMake to recognize most characters in the VAR name since some
environments may have variables with non-C-identifier characters.
Diffstat (limited to 'Source/cmCommandArgumentParser.y')
-rw-r--r-- | Source/cmCommandArgumentParser.y | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmCommandArgumentParser.y b/Source/cmCommandArgumentParser.y index 8f03a4b..055c6c3 100644 --- a/Source/cmCommandArgumentParser.y +++ b/Source/cmCommandArgumentParser.y @@ -91,6 +91,7 @@ static void cmCommandArgumentError(yyscan_t yyscanner, const char* message); /*-------------------------------------------------------------------------*/ /* Tokens */ +%token cal_ENVCURLY %token cal_NCURLY %token cal_DCURLY %token cal_DOLLAR "$" @@ -179,6 +180,12 @@ cal_SYMBOL } Variable: +cal_ENVCURLY EnvVarName cal_RCURLY +{ + $<str>$ = yyGetParser->ExpandSpecialVariable($<str>1,$<str>2); + //std::cerr << __LINE__ << " here: [" << $<str>1 << "] [" << $<str>2 << "] [" << $<str>3 << "]" << std::endl; +} +| cal_NCURLY MultipleIds cal_RCURLY { $<str>$ = yyGetParser->ExpandSpecialVariable($<str>1,$<str>2); @@ -196,6 +203,17 @@ cal_ATNAME $<str>$ = yyGetParser->ExpandVariableForAt($<str>1); } +EnvVarName: +MultipleIds +{ + $<str>$ = $<str>1; +} +| +cal_SYMBOL EnvVarName +{ + $<str>$ = $<str>1; +} + MultipleIds: { $<str>$ = 0; |