parser: Do not call bump recursively

Token normalization is merged directly into `bump`.
Special "unknown macro variable" diagnostic for unexpected `$`s is removed as preventing legal code from compiling.
This commit is contained in:
Vadim Petrochenkov
2020-02-16 16:47:24 +03:00
parent 0176a9eef8
commit d33b3562e5
7 changed files with 38 additions and 52 deletions

View File

@@ -1,7 +1,7 @@
macro_rules! e {
($inp:ident) => (
$nonexistent
//~^ ERROR unknown macro variable `nonexistent`
//~^ ERROR expected expression, found `$`
);
}

View File

@@ -1,8 +1,8 @@
error: unknown macro variable `nonexistent`
error: expected expression, found `$`
--> $DIR/issue-6596-1.rs:3:9
|
LL | $nonexistent
| ^^^^^^^^^^^^ unknown macro variable
| ^^^^^^^^^^^^ expected expression
...
LL | e!(foo);
| -------- in this macro invocation

View File

@@ -3,7 +3,7 @@
macro_rules! g {
($inp:ident) => (
{ $inp $nonexistent }
//~^ ERROR unknown macro variable `nonexistent`
//~^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `$`
);
}

View File

@@ -1,8 +1,8 @@
error: unknown macro variable `nonexistent`
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `$`
--> $DIR/issue-6596-2.rs:5:16
|
LL | { $inp $nonexistent }
| ^^^^^^^^^^^^ unknown macro variable
| ^^^^^^^^^^^^ expected one of 8 possible tokens
...
LL | g!(foo);
| -------- in this macro invocation