Change internal naming of macros.
When a `macro_rules! foo { ... }` invocation is compiled the name used is `foo`, not `macro_rules!`. This is different to all other macro invocations, and confused me when I was inserted debugging println statements for macro evaluation. This commit changes it to `macro_rules` (or just `macro`), which is what I expected. There are no externally visible changes.
This commit is contained in:
parent
027a232755
commit
482b25b321
1 changed files with 2 additions and 1 deletions
|
@ -439,7 +439,8 @@ pub fn compile_declarative_macro(
|
||||||
let argument_gram = mbe::macro_parser::compute_locs(&sess.parse_sess, &argument_gram);
|
let argument_gram = mbe::macro_parser::compute_locs(&sess.parse_sess, &argument_gram);
|
||||||
|
|
||||||
let parser = Parser::new(&sess.parse_sess, body, true, rustc_parse::MACRO_ARGUMENTS);
|
let parser = Parser::new(&sess.parse_sess, body, true, rustc_parse::MACRO_ARGUMENTS);
|
||||||
let mut tt_parser = TtParser::new(def.ident);
|
let mut tt_parser =
|
||||||
|
TtParser::new(Ident::with_dummy_span(if macro_rules { kw::MacroRules } else { kw::Macro }));
|
||||||
let argument_map = match tt_parser.parse_tt(&mut Cow::Borrowed(&parser), &argument_gram) {
|
let argument_map = match tt_parser.parse_tt(&mut Cow::Borrowed(&parser), &argument_gram) {
|
||||||
Success(m) => m,
|
Success(m) => m,
|
||||||
Failure(token, msg) => {
|
Failure(token, msg) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue