Minimal Imperative Parsing Library | https://docs.rs/mipl

add docs for the `Delimiter` trait

ecsolticia.codeberg.page 2e64c84e 1a9e3304

verified
+6
+6
src/lexer/delimiter.rs
··· 6 6 fn new_with_inner(v: HashSet<char>) -> Self; 7 7 fn inner(&self) -> &HashSet<char>; 8 8 } 9 + /// The interface of [DiscardDelimiters] and 10 + /// [KeepDelimiters]. 9 11 pub trait Delimiters: Inner + Sized { 12 + /// Construct a new set of delimiters from 13 + /// a list of characters. 10 14 fn new(vec: Vec<char>) -> Self { 11 15 Self::new_with_inner( 12 16 HashSet::from_iter(vec.iter().cloned()) 13 17 ) 14 18 } 15 19 20 + /// Check if the set of delimiters contains a 21 + /// particular delimiter character. 16 22 fn contains(&self, ch: char) -> bool { 17 23 self.inner().contains(&ch) 18 24 }