diff options
author | John Hodge <tpg@mutabah.net> | 2016-11-03 09:46:19 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-11-03 09:46:19 +0800 |
commit | f239f0bbac2cbd366ebe7cb367f64ba7a555c4f9 (patch) | |
tree | e6325c771f65883f1a9f8a3e3e2b67dbb4be8958 | |
parent | dc69b7313160536c4a361a4474ec361ec3b1e55b (diff) | |
download | mrust-f239f0bbac2cbd366ebe7cb367f64ba7a555c4f9.tar.gz |
Expand env! - option_env! yeild None::<&'static str> instead of just None
-rw-r--r-- | src/expand/env.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/expand/env.cpp b/src/expand/env.cpp index db51fa67..8e087858 100644 --- a/src/expand/env.cpp +++ b/src/expand/env.cpp @@ -59,7 +59,16 @@ class CExpanderOptionEnv: const char* var_val_cstr = getenv(varname.c_str()); if( !var_val_cstr ) { - return box$( TTStreamO(TokenTree(Token(TOK_IDENT, "None"))) ); + ::std::vector< TokenTree> rv; + rv.reserve(7); + rv.push_back( Token(TOK_IDENT, "None") ); + rv.push_back( Token(TOK_DOUBLE_COLON) ); + rv.push_back( Token(TOK_LT) ); + rv.push_back( Token(TOK_AMP) ); + rv.push_back( Token(TOK_LIFETIME, "static") ); + rv.push_back( Token(TOK_IDENT, "str") ); + rv.push_back( Token(TOK_GT) ); + return box$( TTStreamO(TokenTree( {}, mv$(rv) )) ); } else { ::std::vector< TokenTree> rv; |