tangled
alpha
login
or
join now
ecsolticia.codeberg.page
/
mipl
0
fork
atom
Minimal Imperative Parsing Library | https://docs.rs/mipl
0
fork
atom
overview
issues
pulls
pipelines
add docs for the `Delimiter` trait
ecsolticia.codeberg.page
5 months ago
2e64c84e
1a9e3304
verified
This commit was signed with the committer's
known signature
.
ecsolticia.codeberg.page
SSH Key Fingerprint:
SHA256:lc5DuXVjJY1TR+bLCu3j+FiFhpWMq4nZ3jubBpodh1U=
+6
1 changed file
expand all
collapse all
unified
split
src
lexer
delimiter.rs
+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
9
+
/// The interface of [DiscardDelimiters] and
10
10
+
/// [KeepDelimiters].
9
11
pub trait Delimiters: Inner + Sized {
12
12
+
/// Construct a new set of delimiters from
13
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
20
+
/// Check if the set of delimiters contains a
21
21
+
/// particular delimiter character.
16
22
fn contains(&self, ch: char) -> bool {
17
23
self.inner().contains(&ch)
18
24
}