layered_nlp/ll_line/x/token_has_any.rs
1use super::{LLLine, ToIdx, XDirection, XMatch};
2
3pub struct TokenHasAny<'a, Attr: PartialEq> {
4 pub(crate) one_of: &'a [Attr],
5}
6
7impl<'l, Attr: PartialEq + 'static> XMatch<'l> for TokenHasAny<'_, Attr> {
8 type Out = &'l Attr;
9
10 fn go<M>(&self, direction: &M, ll_line: &'l LLLine) -> Vec<(Self::Out, ToIdx)>
11 where
12 M: XDirection<'l>,
13 {
14 direction.token_attr_one_of(self.one_of, ll_line)
15 }
16}