MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / classend

Function classend

Source/Misc/lua/src/lua.c:13879–13900  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13877
13878
13879static const char *classend (MatchState *ms, const char *p) {
13880switch (*p++) {
13881case L_ESC: {
13882if (*p == '\0')
13883luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")");
13884return p+1;
13885}
13886case '[': {
13887if (*p == '^') p++;
13888do { /* look for a `]' */
13889if (*p == '\0')
13890luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")");
13891if (*(p++) == L_ESC && *p != '\0')
13892p++; /* skip escapes (e.g. `%]') */
13893} while (*p != ']');
13894return p+1;
13895}
13896default: {
13897return p;
13898}
13899}
13900}
13901
13902
13903static int match_class (int c, int cl) {

Callers 1

matchFunction · 0.85

Calls 1

luaL_errorFunction · 0.85

Tested by

no test coverage detected