MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / matchbracketclass

Function matchbracketclass

third-party/lua-5.1.5/src/lstrlib.c:245–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243
244
245static int matchbracketclass (int c, const char *p, const char *ec) {
246 int sig = 1;
247 if (*(p+1) == '^') {
248 sig = 0;
249 p++; /* skip the `^' */
250 }
251 while (++p < ec) {
252 if (*p == L_ESC) {
253 p++;
254 if (match_class(c, uchar(*p)))
255 return sig;
256 }
257 else if ((*(p+1) == '-') && (p+2 < ec)) {
258 p+=2;
259 if (uchar(*(p-2)) <= c && c <= uchar(*p))
260 return sig;
261 }
262 else if (uchar(*p) == c) return sig;
263 }
264 return !sig;
265}
266
267
268static int singlematch (int c, const char *p, const char *ep) {

Callers 2

singlematchFunction · 0.70
matchFunction · 0.70

Calls 1

match_classFunction · 0.70

Tested by

no test coverage detected