Add support for "%g" character class in patterns (from Lua 5.2).
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#define LJ_CHAR_IDENT 0x80
|
||||
#define LJ_CHAR_ALPHA (LJ_CHAR_LOWER|LJ_CHAR_UPPER)
|
||||
#define LJ_CHAR_ALNUM (LJ_CHAR_ALPHA|LJ_CHAR_DIGIT)
|
||||
#define LJ_CHAR_GRAPH (LJ_CHAR_ALNUM|LJ_CHAR_PUNCT)
|
||||
|
||||
/* Only pass -1 or 0..255 to these macros. Never pass a signed char! */
|
||||
#define lj_char_isa(c, t) (lj_char_bits[(c)+1] & t)
|
||||
@@ -31,6 +32,7 @@
|
||||
#define lj_char_isident(c) lj_char_isa((c), LJ_CHAR_IDENT)
|
||||
#define lj_char_isalpha(c) lj_char_isa((c), LJ_CHAR_ALPHA)
|
||||
#define lj_char_isalnum(c) lj_char_isa((c), LJ_CHAR_ALNUM)
|
||||
#define lj_char_isgraph(c) lj_char_isa((c), LJ_CHAR_GRAPH)
|
||||
|
||||
#define lj_char_toupper(c) ((c) - (lj_char_islower(c) >> 1))
|
||||
#define lj_char_tolower(c) ((c) + lj_char_isupper(c))
|
||||
|
||||
Reference in New Issue
Block a user