just_lsp/attribute_kind.rs
1use super::*;
2
3#[derive(Debug, Clone, Copy)]
4pub enum AttributeKind {
5 Binary,
6 Nullary,
7 Optional,
8 Unary,
9 UnaryPlus,
10 Variadic,
11}
12
13impl AttributeKind {
14 #[must_use]
15 pub fn argument_range(self) -> RangeInclusive<usize> {
16 match self {
17 Self::Binary => 2..=2,
18 Self::Nullary => 0..=0,
19 Self::Optional => 0..=1,
20 Self::Unary => 1..=1,
21 Self::UnaryPlus => 1..=usize::MAX,
22 Self::Variadic => 0..=usize::MAX,
23 }
24 }
25}