aboutsummaryrefslogtreecommitdiffstats
path: root/src/parse/regex/bc.rs
diff options
context:
space:
mode:
authorJonas Maier <jonas@x77.dev>2026-06-05 15:12:46 +0200
committerJonas Maier <jonas@x77.dev>2026-06-05 15:12:46 +0200
commit65013cb7441dcd56d362613e1ebc469756613b24 (patch)
tree243974c9fba86d51f893714d7fe88d7b83799ec1 /src/parse/regex/bc.rs
parenta464bec4d558533776329634504ab0c1bee84bba (diff)
downloadpish-65013cb7441dcd56d362613e1ebc469756613b24.tar.gz
make it compile
Diffstat (limited to 'src/parse/regex/bc.rs')
-rw-r--r--src/parse/regex/bc.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/parse/regex/bc.rs b/src/parse/regex/bc.rs
index 90761fd..eec5628 100644
--- a/src/parse/regex/bc.rs
+++ b/src/parse/regex/bc.rs
@@ -8,12 +8,12 @@ use crate::{
trait Flavor: Clone {
type CustomInstr: Copy + Clone;
type ThreadData: Clone;
- type StepData<'a>;
+ type StepData<'a, 'b> where 'b : 'a;
fn accepts<'a, 'b>(
thread: &mut Thread<Self>,
instr: Self::CustomInstr,
- sd: &mut Self::StepData<'a>,
+ sd: &mut Self::StepData<'a, 'b>,
) -> bool;
}
@@ -22,12 +22,12 @@ struct MainFlavor;
impl Flavor for MainFlavor {
type CustomInstr = MainInstr;
type ThreadData = Box<[usize]>;
- type StepData<'a> = (usize, &'a BitSet, &'a mut LookaheadVM<'a>);
+ type StepData<'a, 'b> = (usize, &'a BitSet, &'a mut LookaheadVM<'b>) where 'b : 'a;
- fn accepts<'a>(
+ fn accepts<'a, 'b>(
thread: &mut Thread<Self>,
instr: Self::CustomInstr,
- data: &mut Self::StepData<'a>,
+ data: &mut Self::StepData<'a, 'b>,
) -> bool {
match instr {
MainInstr::Save(reg) => {
@@ -55,7 +55,7 @@ struct AssertionFlavor;
impl Flavor for AssertionFlavor {
type CustomInstr = Nothing;
type ThreadData = ();
- type StepData<'a> = ();
+ type StepData<'a, 'b> = () where 'b : 'a;
fn accepts(_thread: &mut Thread<Self>, instr: Self::CustomInstr, _sd: &mut ()) -> bool {
match instr {}
@@ -115,7 +115,7 @@ impl<'p, F: Flavor> VM<'p, F> {
}
}
- fn step<'a>(&mut self, byte: u8, sd: &mut F::StepData<'a>) {
+ fn step<'a>(&mut self, byte: u8, sd: &mut F::StepData<'a, 'p>) {
let mut threads: VecDeque<_> = self.threads.drain(..).collect();
self.hot.set_all(false);
@@ -203,7 +203,7 @@ struct VirtualMachine<'a> {
}
impl<'a> VirtualMachine<'a> {
- fn step(&'a mut self, byte: u8, loc: usize) {
+ fn step(&mut self, byte: u8, loc: usize) {
self.vm0.step(byte, &mut ());
self.vm1
.step(byte, &mut (loc, &self.vm0.hot, &mut self.vm2));