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

Function classend

third-party/lua-5.5.0/src/lstrlib.c:405–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403
404
405static const char *classend (MatchState *ms, const char *p) {
406 switch (*p++) {
407 case L_ESC: {
408 if (l_unlikely(p == ms->p_end))
409 luaL_error(ms->L, "malformed pattern (ends with '%%')");
410 return p+1;
411 }
412 case '[': {
413 if (*p == '^') p++;
414 do { /* look for a ']' */
415 if (l_unlikely(p == ms->p_end))
416 luaL_error(ms->L, "malformed pattern (missing ']')");
417 if (*(p++) == L_ESC && p < ms->p_end)
418 p++; /* skip escapes (e.g. '%]') */
419 } while (*p != ']');
420 return p+1;
421 }
422 default: {
423 return p;
424 }
425 }
426}
427
428
429static int match_class (int c, int cl) {

Callers 1

matchFunction · 0.70

Calls 1

luaL_errorFunction · 0.70

Tested by

no test coverage detected