formualizer_common/
function.rs

1#[derive(Copy, Clone, Debug, Eq, PartialEq)]
2pub enum ArgKind {
3    Number,
4    Text,
5    Logical,
6    Range,
7    Any,
8}
9
10impl ArgKind {
11    pub fn parse(s: &str) -> Self {
12        match s.trim().to_ascii_lowercase().as_str() {
13            "number" => Self::Number,
14            "text" => Self::Text,
15            "logical" => Self::Logical,
16            "range" => Self::Range,
17            "" | "_" | "any" => Self::Any,
18            other => panic!("Unknown arg kind '{other}'"),
19        }
20    }
21}