MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / matchbracketclass

Function matchbracketclass

Source/Misc/lua/src/lua.c:13922–13942  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13920
13921
13922static int matchbracketclass (int c, const char *p, const char *ec) {
13923int sig = 1;
13924if (*(p+1) == '^') {
13925sig = 0;
13926p++; /* skip the `^' */
13927}
13928while (++p < ec) {
13929if (*p == L_ESC) {
13930p++;
13931if (match_class(c, uchar(*p)))
13932return sig;
13933}
13934else if ((*(p+1) == '-') && (p+2 < ec)) {
13935p+=2;
13936if (uchar(*(p-2)) <= c && c <= uchar(*p))
13937return sig;
13938}
13939else if (uchar(*p) == c) return sig;
13940}
13941return !sig;
13942}
13943
13944
13945static int singlematch (int c, const char *p, const char *ep) {

Callers 2

singlematchFunction · 0.85
matchFunction · 0.85

Calls 1

match_classFunction · 0.85

Tested by

no test coverage detected