diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-03-10 14:42:33 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-03-10 14:42:33 -0300 |
| commit | 6427c61e7c3e6acd467b488c573ac37b0f46d0a2 (patch) | |
| tree | f0471d4313741f31d813894f01ef4ce72b1df5d0 | |
| parent | ba484b9eb16dd62a7c3a5400a66eb952b654d3f0 (diff) | |
| download | lua-6427c61e7c3e6acd467b488c573ac37b0f46d0a2.tar.gz lua-6427c61e7c3e6acd467b488c573ac37b0f46d0a2.tar.bz2 lua-6427c61e7c3e6acd467b488c573ac37b0f46d0a2.zip | |
added macro 'lisxdigit' (just in case :)
| -rw-r--r-- | lctype.c | 10 | ||||
| -rw-r--r-- | lctype.h | 4 |
2 files changed, 8 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lctype.c,v 1.1 2009/02/19 17:18:25 roberto Exp roberto $ | 2 | ** $Id: lctype.c,v 1.2 2009/02/20 13:11:15 roberto Exp roberto $ |
| 3 | ** 'ctype' functions for Lua | 3 | ** 'ctype' functions for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -15,13 +15,13 @@ const char luai_ctype_[UCHAR_MAX + 1] = { | |||
| 15 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 15 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 16 | 0x0c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | 16 | 0x0c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, |
| 17 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | 17 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, |
| 18 | 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, | 18 | 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, |
| 19 | 0x06, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | 19 | 0x16, 0x16, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, |
| 20 | 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, | 20 | 0x04, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x05, |
| 21 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, | 21 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, |
| 22 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, | 22 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, |
| 23 | 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, | 23 | 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, |
| 24 | 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, | 24 | 0x04, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x05, |
| 25 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, | 25 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, |
| 26 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, | 26 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, |
| 27 | 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x00, | 27 | 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x00, |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lctype.h,v 1.1 2009/02/19 17:18:25 roberto Exp roberto $ | 2 | ** $Id: lctype.h,v 1.2 2009/02/20 13:11:15 roberto Exp roberto $ |
| 3 | ** 'ctype' functions for Lua | 3 | ** 'ctype' functions for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -17,6 +17,7 @@ | |||
| 17 | #define DIGITBIT 1 | 17 | #define DIGITBIT 1 |
| 18 | #define PRINTBIT 2 | 18 | #define PRINTBIT 2 |
| 19 | #define SPACEBIT 3 | 19 | #define SPACEBIT 3 |
| 20 | #define XDIGITBIT 4 | ||
| 20 | 21 | ||
| 21 | 22 | ||
| 22 | #define MASK(B) (1 << (B)) | 23 | #define MASK(B) (1 << (B)) |
| @@ -27,6 +28,7 @@ | |||
| 27 | #define lisdigit(x) (luai_ctype_[x] & MASK(DIGITBIT)) | 28 | #define lisdigit(x) (luai_ctype_[x] & MASK(DIGITBIT)) |
| 28 | #define lisspace(x) (luai_ctype_[x] & MASK(SPACEBIT)) | 29 | #define lisspace(x) (luai_ctype_[x] & MASK(SPACEBIT)) |
| 29 | #define lisprint(x) (luai_ctype_[x] & MASK(PRINTBIT)) | 30 | #define lisprint(x) (luai_ctype_[x] & MASK(PRINTBIT)) |
| 31 | #define lisxdigit(x) (luai_ctype_[x] & MASK(XDIGITBIT)) | ||
| 30 | 32 | ||
| 31 | LUAI_DATA const char luai_ctype_[UCHAR_MAX + 1]; | 33 | LUAI_DATA const char luai_ctype_[UCHAR_MAX + 1]; |
| 32 | 34 | ||
