syntax: Fix wrong span on ObsoleteMode
This commit is contained in:
parent
d96dfc9a59
commit
a56e2eecf5
1 changed files with 6 additions and 4 deletions
|
@ -1213,14 +1213,16 @@ impl Parser {
|
||||||
// parse an optional, obsolete argument mode.
|
// parse an optional, obsolete argument mode.
|
||||||
pub fn parse_arg_mode(&self) {
|
pub fn parse_arg_mode(&self) {
|
||||||
if self.eat(&token::BINOP(token::MINUS)) {
|
if self.eat(&token::BINOP(token::MINUS)) {
|
||||||
self.obsolete(*self.span, ObsoleteMode);
|
self.obsolete(*self.last_span, ObsoleteMode);
|
||||||
} else if self.eat(&token::ANDAND) {
|
} else if self.eat(&token::ANDAND) {
|
||||||
self.obsolete(*self.span, ObsoleteMode);
|
self.obsolete(*self.last_span, ObsoleteMode);
|
||||||
} else if self.eat(&token::BINOP(token::PLUS)) {
|
} else if self.eat(&token::BINOP(token::PLUS)) {
|
||||||
|
let lo = self.last_span.lo;
|
||||||
if self.eat(&token::BINOP(token::PLUS)) {
|
if self.eat(&token::BINOP(token::PLUS)) {
|
||||||
self.obsolete(*self.span, ObsoleteMode);
|
let hi = self.last_span.hi;
|
||||||
|
self.obsolete(mk_sp(lo, hi), ObsoleteMode);
|
||||||
} else {
|
} else {
|
||||||
self.obsolete(*self.span, ObsoleteMode);
|
self.obsolete(*self.last_span, ObsoleteMode);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Ignore.
|
// Ignore.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue