Skip to content

Commit 07668e6

Browse files
committed
Rename lookaround_index
1 parent 6192349 commit 07668e6

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

regex-automata/src/nfa/thompson/nfa.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,10 +1385,10 @@ impl Inner {
13851385
State::Capture { .. } => {
13861386
self.has_capture = true;
13871387
}
1388-
State::CheckLookAround { lookaround_index: look_idx, .. }
1389-
| State::WriteLookAround { lookaround_index: look_idx } => {
1388+
State::CheckLookAround { lookaround_index, .. }
1389+
| State::WriteLookAround { lookaround_index } => {
13901390
self.lookaround_count =
1391-
self.lookaround_count.max(look_idx.as_usize() + 1);
1391+
self.lookaround_count.max(lookaround_index.as_usize() + 1);
13921392
}
13931393
State::Union { .. }
13941394
| State::BinaryUnion { .. }
@@ -1795,18 +1795,14 @@ impl fmt::Debug for State {
17951795
State::Look { ref look, next } => {
17961796
write!(f, "{:?} => {:?}", look, next.as_usize())
17971797
}
1798-
State::WriteLookAround { lookaround_index: look_idx } => {
1799-
write!(f, "write-look-around({})", look_idx.as_u32())
1798+
State::WriteLookAround { lookaround_index } => {
1799+
write!(f, "write-look-around({})", lookaround_index.as_u32())
18001800
}
1801-
State::CheckLookAround {
1802-
lookaround_index: look_idx,
1803-
positive,
1804-
next,
1805-
} => {
1801+
State::CheckLookAround { lookaround_index, positive, next } => {
18061802
write!(
18071803
f,
18081804
"check-look-around({} is {}) => {}",
1809-
look_idx.as_u32(),
1805+
lookaround_index.as_u32(),
18101806
if positive { "matched" } else { "not matched" },
18111807
next.as_usize()
18121808
)

regex-automata/src/nfa/thompson/pikevm.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,17 +1772,17 @@ impl PikeVM {
17721772
}
17731773
sid = next;
17741774
}
1775-
State::WriteLookAround { lookaround_index: look_idx } => {
1775+
State::WriteLookAround { lookaround_index } => {
17761776
// This is ok since `at` is always less than `usize::MAX`.
1777-
lookarounds[look_idx] = NonMaxUsize::new(at);
1777+
lookarounds[lookaround_index] = NonMaxUsize::new(at);
17781778
return;
17791779
}
17801780
State::CheckLookAround {
1781-
lookaround_index: look_idx,
1781+
lookaround_index,
17821782
positive,
17831783
next,
17841784
} => {
1785-
let state = match lookarounds[look_idx] {
1785+
let state = match lookarounds[lookaround_index] {
17861786
None => usize::MAX,
17871787
Some(pos) => pos.get(),
17881788
};

0 commit comments

Comments
 (0)