aboutsummaryrefslogtreecommitdiff
path: root/misc.c
blob: b8eb3296d272c1dedc893f0dfa2f103398db3a44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "misc.h"

#include <wctype.h>

bool
isword(wchar_t wc, bool spaces_only)
{
    if (spaces_only)
        return iswgraph(wc);

    switch (wc) {
    default: return iswgraph(wc);

    case L'(': case L')':
    case L'[': case L']':
    case L'{': case L'}':
    case L'<': case L'>':
    case L'│': case L'|':
    case L',':
    case L'`': case L'"': case L'\'':
    case L':':
        return false;
    }
}