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

Function matchbracketclass

third-party/lua-5.2.4/src/lstrlib.c:286–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284
285
286static int matchbracketclass (int c, const char *p, const char *ec) {
287 int sig = 1;
288 if (*(p+1) == '^') {
289 sig = 0;
290 p++; /* skip the `^' */
291 }
292 while (++p < ec) {
293 if (*p == L_ESC) {
294 p++;
295 if (match_class(c, uchar(*p)))
296 return sig;
297 }
298 else if ((*(p+1) == '-') && (p+2 < ec)) {
299 p+=2;
300 if (uchar(*(p-2)) <= c && c <= uchar(*p))
301 return sig;
302 }
303 else if (uchar(*p) == c) return sig;
304 }
305 return !sig;
306}
307
308
309static int singlematch (MatchState *ms, const char *s, const char *p,

Callers 2

singlematchFunction · 0.70
matchFunction · 0.70

Calls 1

match_classFunction · 0.70

Tested by

no test coverage detected