Пример #1
0
/// Test if the given string is a valid variable name.
///
/// \return null if this is a valid name, and a pointer to the first invalid character otherwise.
const wchar_t *wcsvarname(const wchar_t *str) {
    while (*str) {
        if ((!fish_iswalnum(*str)) && (*str != L'_')) {
            return str;
        }
        str++;
    }
    return NULL;
}
Пример #2
0
/// Test if the given string is valid in a variable name.
///
/// \return true if this is a valid name, false otherwise.
bool wcsvarchr(wchar_t chr) { return fish_iswalnum(chr) || chr == L'_'; }