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

Function classend

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

Source from the content-addressed store, hash-verified

200
201
202static const char *classend (MatchState *ms, const char *p) {
203 switch (*p++) {
204 case L_ESC: {
205 if (*p == '\0')
206 luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")");
207 return p+1;
208 }
209 case '[': {
210 if (*p == '^') p++;
211 do { /* look for a `]' */
212 if (*p == '\0')
213 luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")");
214 if (*(p++) == L_ESC && *p != '\0')
215 p++; /* skip escapes (e.g. `%]') */
216 } while (*p != ']');
217 return p+1;
218 }
219 default: {
220 return p;
221 }
222 }
223}
224
225
226static int match_class (int c, int cl) {

Callers 1

matchFunction · 0.70

Calls 1

luaL_errorFunction · 0.70

Tested by

no test coverage detected