nomux-extension 0.1.2

The nomux extension SDK: the daemon part of an extension and the extension manifest
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! The name syntax of identifiers, slots and scopes.

/// A name starts with a lower-case letter and has only lower-case letters,
/// digits and `-`.
pub(crate) fn is_name(text: &str) -> bool {
    let mut bytes = text.bytes();
    bytes.next().is_some_and(|byte| byte.is_ascii_lowercase())
        && bytes.all(|byte| byte.is_ascii_lowercase() || byte.is_ascii_digit() || byte == b'-')
}

/// One or more names with `.` between them.
pub(crate) fn is_dotted_name(text: &str) -> bool {
    text.split('.').all(is_name)
}