Skip to content

Commit 57d6ada

Browse files
committed
Rename sp_lo to sp_open
1 parent a1dd39e commit 57d6ada

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/libsyntax/ext/tt/macro_parser.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ struct MatcherPos<'a> {
151151
top_elts: TokenTreeOrTokenTreeSlice<'a>,
152152
/// The position of the "dot" in this matcher
153153
idx: usize,
154-
/// The beginning position in the source that the beginning of this matcher corresponds to. In
155-
/// other words, the token in the source at `sp_lo` is matched against the first token of the
156-
/// matcher.
157-
sp_lo: Span,
154+
/// The first span of source source that the beginning of this matcher corresponds to. In other
155+
/// words, the token in the source whose span is `sp_open` is matched against the first token of
156+
/// the matcher.
157+
sp_open: Span,
158158

159159
/// For each named metavar in the matcher, we keep track of token trees matched against the
160160
/// metavar by the black box parser. In particular, there may be more than one match per
@@ -284,17 +284,17 @@ fn create_matches(len: usize) -> Vec<Rc<Vec<NamedMatch>>> {
284284
}
285285

286286
/// Generate the top-level matcher position in which the "dot" is before the first token of the
287-
/// matcher `ms` and we are going to start matching at position `lo` in the source.
288-
fn initial_matcher_pos(ms: &[TokenTree], lo: Span) -> MatcherPos {
287+
/// matcher `ms` and we are going to start matching at the span `open` in the source.
288+
fn initial_matcher_pos(ms: &[TokenTree], open: Span) -> MatcherPos {
289289
let match_idx_hi = count_names(ms);
290290
let matches = create_matches(match_idx_hi);
291291
MatcherPos {
292292
// Start with the top level matcher given to us
293293
top_elts: TtSeq(ms), // "elts" is an abbr. for "elements"
294294
// The "dot" is before the first token of the matcher
295295
idx: 0,
296-
// We start matching with byte `lo` in the source code
297-
sp_lo: lo,
296+
// We start matching at the span `open` in the source code
297+
sp_open: open,
298298

299299
// Initialize `matches` to a bunch of empty `Vec`s -- one for each metavar in `top_elts`.
300300
// `match_lo` for `top_elts` is 0 and `match_hi` is `matches.len()`. `match_cur` is 0 since
@@ -488,7 +488,7 @@ fn inner_parse_loop<'a>(
488488
// Add matches from this repetition to the `matches` of `up`
489489
for idx in item.match_lo..item.match_hi {
490490
let sub = item.matches[idx].clone();
491-
let span = DelimSpan::from_pair(item.sp_lo, span);
491+
let span = DelimSpan::from_pair(item.sp_open, span);
492492
new_pos.push_match(idx, MatchedSeq(sub, span));
493493
}
494494

@@ -556,7 +556,7 @@ fn inner_parse_loop<'a>(
556556
match_cur: item.match_cur,
557557
match_hi: item.match_cur + seq.num_captures,
558558
up: Some(item),
559-
sp_lo: sp.open,
559+
sp_open: sp.open,
560560
top_elts: Tt(TokenTree::Sequence(sp, seq)),
561561
})));
562562
}

0 commit comments

Comments
 (0)