diff --git a/default-streams/src/pos/mod.rs b/default-streams/src/pos/mod.rs index b0a7887..5f41f3d 100644 --- a/default-streams/src/pos/mod.rs +++ b/default-streams/src/pos/mod.rs @@ -1,5 +1,6 @@ mod index; mod newline; +mod nop; pub use index::IndexPosCounter; pub use newline::PosLineCol; diff --git a/default-streams/src/pos/nop.rs b/default-streams/src/pos/nop.rs new file mode 100644 index 0000000..d8be3c8 --- /dev/null +++ b/default-streams/src/pos/nop.rs @@ -0,0 +1,12 @@ +use crate::iterator::PosCounter; +pub struct NopPosCounter {} + +impl PosCounter<'static, C, ()> for NopPosCounter { + fn update(&mut self, c: C) {} + + fn export(&self) {} + + fn init() -> Self { + return NopPosCounter {}; + } +} diff --git a/src/lib.rs b/src/lib.rs index 15fb1a2..e35b668 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,6 +6,7 @@ pub trait Predicate { pub trait Pos<'pos> {} +impl Pos<'static> for () {} impl Pos<'static> for usize {} pub trait KeywordComparatorIterator<'keyword, C> {