mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Fix trace_macros so that it works.
This commit is contained in:
parent
a88f9ac732
commit
9ff8d18766
@ -15,12 +15,16 @@ fn expand_trace_macros(cx: ext_ctxt, sp: span,
|
||||
let rdr = tt_rdr as reader;
|
||||
let rust_parser = Parser(sess, cfg, rdr.dup());
|
||||
|
||||
let arg = cx.str_of(rust_parser.parse_ident());
|
||||
match arg {
|
||||
~"true" => cx.set_trace_macros(true),
|
||||
~"false" => cx.set_trace_macros(false),
|
||||
_ => cx.span_fatal(sp, ~"trace_macros! only accepts `true` or `false`")
|
||||
if rust_parser.is_keyword(~"true") {
|
||||
cx.set_trace_macros(true);
|
||||
} else if rust_parser.is_keyword(~"false") {
|
||||
cx.set_trace_macros(false);
|
||||
} else {
|
||||
cx.span_fatal(sp, ~"trace_macros! only accepts `true` or `false`")
|
||||
}
|
||||
|
||||
rust_parser.bump();
|
||||
|
||||
let rust_parser = Parser(sess, cfg, rdr.dup());
|
||||
let result = rust_parser.parse_expr();
|
||||
base::mr_expr(result)
|
||||
|
Loading…
Reference in New Issue
Block a user