MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / classend

Function classend

src/Chain/libraries/glua/lstrlib.cpp:269–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267
268
269static const char *classend(MatchState *ms, const char *p) {
270 switch (*p++) {
271 case L_ESC: {
272 if (p == ms->p_end)
273 luaL_error(ms->L, "malformed pattern (ends with '%%')");
274 return p + 1;
275 }
276 case '[': {
277 if (*p == '^') p++;
278 do { /* look for a ']' */
279 if (p == ms->p_end)
280 luaL_error(ms->L, "malformed pattern (missing ']')");
281 if (*(p++) == L_ESC && p < ms->p_end)
282 p++; /* skip escapes (e.g. '%]') */
283 } while (*p != ']');
284 return p + 1;
285 }
286 default: {
287 return p;
288 }
289 }
290}
291
292
293static int match_class(int c, int cl) {

Callers 1

matchFunction · 0.85

Calls 1

luaL_errorFunction · 0.85

Tested by

no test coverage detected