mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Small parser cleanups
This commit is contained in:
parent
8d13b2a046
commit
6c47848c25
@ -451,7 +451,7 @@ impl TtParser {
|
|||||||
// Try zero matches of this sequence, by skipping over it.
|
// Try zero matches of this sequence, by skipping over it.
|
||||||
self.cur_mps.push(MatcherPos {
|
self.cur_mps.push(MatcherPos {
|
||||||
idx: idx_first_after,
|
idx: idx_first_after,
|
||||||
matches: mp.matches.clone(), // a cheap clone
|
matches: Lrc::clone(&mp.matches),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ impl TtParser {
|
|||||||
// processed next time around the loop.
|
// processed next time around the loop.
|
||||||
let ending_mp = MatcherPos {
|
let ending_mp = MatcherPos {
|
||||||
idx: mp.idx + 1, // +1 skips the Kleene op
|
idx: mp.idx + 1, // +1 skips the Kleene op
|
||||||
matches: mp.matches.clone(), // a cheap clone
|
matches: Lrc::clone(&mp.matches),
|
||||||
};
|
};
|
||||||
self.cur_mps.push(ending_mp);
|
self.cur_mps.push(ending_mp);
|
||||||
|
|
||||||
@ -481,7 +481,7 @@ impl TtParser {
|
|||||||
// will fail quietly when it is processed next time around the loop.
|
// will fail quietly when it is processed next time around the loop.
|
||||||
let ending_mp = MatcherPos {
|
let ending_mp = MatcherPos {
|
||||||
idx: mp.idx + 2, // +2 skips the separator and the Kleene op
|
idx: mp.idx + 2, // +2 skips the separator and the Kleene op
|
||||||
matches: mp.matches.clone(), // a cheap clone
|
matches: Lrc::clone(&mp.matches),
|
||||||
};
|
};
|
||||||
self.cur_mps.push(ending_mp);
|
self.cur_mps.push(ending_mp);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user