commit
99df8a3f15
@ -43,7 +43,7 @@ pub fn expand_env(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
|
||||
|
||||
let (var, _var_str_style) = expr_to_str(cx, exprs[0], "expected string literal");
|
||||
let msg = match exprs.len() {
|
||||
1 => format!("Environment variable {} not defined", var).to_managed(),
|
||||
1 => format!("environment variable `{}` not defined", var).to_managed(),
|
||||
2 => {
|
||||
let (s, _style) = expr_to_str(cx, exprs[1], "expected string literal");
|
||||
s
|
||||
|
@ -351,9 +351,9 @@ pub fn parse(sess: @ParseSess,
|
||||
}
|
||||
return Success(nameize(sess, ms, v));
|
||||
} else if eof_eis.len() > 1u {
|
||||
return Error(sp, ~"Ambiguity: multiple successful parses");
|
||||
return Error(sp, ~"ambiguity: multiple successful parses");
|
||||
} else {
|
||||
return Failure(sp, ~"Unexpected end of macro invocation");
|
||||
return Failure(sp, ~"unexpected end of macro invocation");
|
||||
}
|
||||
} else {
|
||||
if (bb_eis.len() > 0u && next_eis.len() > 0u)
|
||||
@ -367,12 +367,12 @@ pub fn parse(sess: @ParseSess,
|
||||
_ => fail!()
|
||||
} }).connect(" or ");
|
||||
return Error(sp, format!(
|
||||
"Local ambiguity: multiple parsing options: \
|
||||
"local ambiguity: multiple parsing options: \
|
||||
built-in NTs {} or {} other options.",
|
||||
nts, next_eis.len()));
|
||||
} else if (bb_eis.len() == 0u && next_eis.len() == 0u) {
|
||||
return Failure(sp, ~"No rules expected the token: "
|
||||
+ to_str(get_ident_interner(), &tok));
|
||||
return Failure(sp, format!("no rules expected the token `{}`",
|
||||
to_str(get_ident_interner(), &tok)));
|
||||
} else if (next_eis.len() > 0u) {
|
||||
/* Now process the next token */
|
||||
while(next_eis.len() > 0u) {
|
||||
|
@ -8,4 +8,4 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn main() { env!("__HOPEFULLY_NOT_DEFINED__"); } //~ ERROR: Environment variable __HOPEFULLY_NOT_DEFINED__ not defined
|
||||
fn main() { env!("__HOPEFULLY_NOT_DEFINED__"); } //~ ERROR: environment variable `__HOPEFULLY_NOT_DEFINED__` not defined
|
||||
|
Loading…
x
Reference in New Issue
Block a user