Skip to content

Commit a0d8873

Browse files
committed
More accurate spans
1 parent b42ea7f commit a0d8873

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/libsyntax/parse/attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl parser_attr for Parser {
156156
@spanned(lo, hi, ast::meta_list(name, inner_items))
157157
}
158158
_ => {
159-
let hi = self.span.hi;
159+
let hi = self.last_span.hi;
160160
@spanned(lo, hi, ast::meta_word(name))
161161
}
162162
}

src/libsyntax/parse/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ pub impl Parser {
122122
fn parse_path_list_ident(&self) -> ast::path_list_ident {
123123
let lo = self.span.lo;
124124
let ident = self.parse_ident();
125-
let hi = self.span.hi;
125+
let hi = self.last_span.hi;
126126
spanned(lo, hi, ast::path_list_ident_ { name: ident,
127127
id: self.get_id() })
128128
}

src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,7 +2445,7 @@ pub impl Parser {
24452445
}
24462446
}
24472447
}
2448-
hi = self.span.hi;
2448+
hi = self.last_span.hi;
24492449
}
24502450
}
24512451
@ast::pat { id: self.get_id(), node: pat, span: mk_sp(lo, hi) }
@@ -4311,7 +4311,7 @@ pub impl Parser {
43114311
rp: None,
43124312
types: ~[] };
43134313
return @spanned(lo,
4314-
self.span.hi,
4314+
self.last_span.hi,
43154315
view_path_simple(last, path, self.get_id()));
43164316
}
43174317

0 commit comments

Comments
 (0)