MCPcopy Create free account
hub / github.com/SpartanJ/eepp / classend

Function classend

src/eepp/system/lua-str.cpp:86–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86static const char* classend( MatchState* ms, const char* p ) {
87 switch ( *p++ ) {
88 case L_ESC: {
89 if ( p == ms->p_end )
90 throw_error( "malformed pattern (ends with '%')" );
91 return p + 1;
92 }
93 case '[': {
94 if ( *p == '^' )
95 p++;
96 do { /* look for a `]' */
97 if ( p == ms->p_end )
98 throw_error( "malformed pattern (missing ']')" );
99 if ( *( p++ ) == L_ESC && p < ms->p_end )
100 p++; /* skip escapes (e.g. `%]') */
101 } while ( *p != ']' );
102 return p + 1;
103 }
104 default: {
105 return p;
106 }
107 }
108}
109
110static int match_class( int c, int cl ) {
111 int res;

Callers 1

matchFunction · 0.85

Calls 1

throw_errorFunction · 0.85

Tested by

no test coverage detected