Noop pos counter

This commit is contained in:
Andrew Golovashevich 2025-11-15 19:37:28 +03:00
parent 04ec6f5acc
commit 1d152cd78f
3 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,6 @@
mod index; mod index;
mod newline; mod newline;
mod nop;
pub use index::IndexPosCounter; pub use index::IndexPosCounter;
pub use newline::PosLineCol; pub use newline::PosLineCol;

View File

@ -0,0 +1,12 @@
use crate::iterator::PosCounter;
pub struct NopPosCounter {}
impl<C> PosCounter<'static, C, ()> for NopPosCounter {
fn update(&mut self, c: C) {}
fn export(&self) {}
fn init() -> Self {
return NopPosCounter {};
}
}

View File

@ -6,6 +6,7 @@ pub trait Predicate<C> {
pub trait Pos<'pos> {} pub trait Pos<'pos> {}
impl Pos<'static> for () {}
impl Pos<'static> for usize {} impl Pos<'static> for usize {}
pub trait KeywordComparatorIterator<'keyword, C> { pub trait KeywordComparatorIterator<'keyword, C> {