MCPcopy Create free account
hub / github.com/F-Stack/f-stack / classend

Function classend

freebsd/contrib/openzfs/module/lua/lstrlib.c:253–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251
252
253static const char *classend (MatchState *ms, const char *p) {
254 switch (*p++) {
255 case L_ESC: {
256 if (p == ms->p_end)
257 luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")");
258 return p+1;
259 }
260 case '[': {
261 if (*p == '^') p++;
262 do { /* look for a `]' */
263 if (p == ms->p_end)
264 luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")");
265 if (*(p++) == L_ESC && p < ms->p_end)
266 p++; /* skip escapes (e.g. `%]') */
267 } while (*p != ']');
268 return p+1;
269 }
270 default: {
271 return p;
272 }
273 }
274}
275
276
277static int match_class (int c, int cl) {

Callers 1

matchFunction · 0.70

Calls 1

luaL_errorFunction · 0.70

Tested by

no test coverage detected