boseiju/lexer/tokens/intermediates/
not_of_a_kind.rs

1#[derive(serde::Serialize, serde::Deserialize)]
2#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
3pub struct NotOfAKind {
4    #[cfg(feature = "spanned_tree")]
5    pub span: crate::ability_tree::span::TreeSpan,
6}
7
8impl NotOfAKind {
9    pub const COUNT: usize = 1;
10    pub const fn id(&self) -> usize {
11        0
12    }
13
14    pub fn try_from_span(span: &crate::lexer::Span) -> Option<Self> {
15        match span.text {
16            "non-" => Some(NotOfAKind {
17                #[cfg(feature = "spanned_tree")]
18                span: span.into(),
19            }),
20            _ => None,
21        }
22    }
23}