Fix trace_macros so that it works.
This commit is contained in:
parent
a88f9ac732
commit
9ff8d18766
1 changed files with 9 additions and 5 deletions
|
@ -15,12 +15,16 @@ fn expand_trace_macros(cx: ext_ctxt, sp: span,
|
||||||
let rdr = tt_rdr as reader;
|
let rdr = tt_rdr as reader;
|
||||||
let rust_parser = Parser(sess, cfg, rdr.dup());
|
let rust_parser = Parser(sess, cfg, rdr.dup());
|
||||||
|
|
||||||
let arg = cx.str_of(rust_parser.parse_ident());
|
if rust_parser.is_keyword(~"true") {
|
||||||
match arg {
|
cx.set_trace_macros(true);
|
||||||
~"true" => cx.set_trace_macros(true),
|
} else if rust_parser.is_keyword(~"false") {
|
||||||
~"false" => cx.set_trace_macros(false),
|
cx.set_trace_macros(false);
|
||||||
_ => cx.span_fatal(sp, ~"trace_macros! only accepts `true` or `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 rust_parser = Parser(sess, cfg, rdr.dup());
|
||||||
let result = rust_parser.parse_expr();
|
let result = rust_parser.parse_expr();
|
||||||
base::mr_expr(result)
|
base::mr_expr(result)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue