Add support for "%g" character class in patterns (from Lua 5.2).

This commit is contained in:
Mike Pall
2010-11-19 18:37:10 +01:00
parent 7cc981c140
commit 52fd87bf34
2 changed files with 5 additions and 3 deletions

View File

@@ -181,9 +181,9 @@ static const char *classend(MatchState *ms, const char *p)
}
static const unsigned char match_class_map[32] = {
0, LJ_CHAR_ALPHA, 0, LJ_CHAR_CNTRL, LJ_CHAR_DIGIT, 0,0,0,0,0,0,0,
LJ_CHAR_LOWER, 0,0,0, LJ_CHAR_PUNCT, 0,0, LJ_CHAR_SPACE, 0,
LJ_CHAR_UPPER, 0, LJ_CHAR_ALNUM, LJ_CHAR_XDIGIT, 0,0,0,0,0,0,0
0,LJ_CHAR_ALPHA,0,LJ_CHAR_CNTRL,LJ_CHAR_DIGIT,0,0,LJ_CHAR_GRAPH,0,0,0,0,
LJ_CHAR_LOWER,0,0,0,LJ_CHAR_PUNCT,0,0,LJ_CHAR_SPACE,0,
LJ_CHAR_UPPER,0,LJ_CHAR_ALNUM,LJ_CHAR_XDIGIT,0,0,0,0,0,0,0
};
static int match_class(int c, int cl)