diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-03-03 10:16:14 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-03-03 10:16:14 +0000 |
commit | 369124b0ec6aa0d58ea628339713444c559bfa5f (patch) | |
tree | 69b7aaee156382355dbde6cd1302bb73d2e3e6c9 /regex.h | |
parent | 0861165bdcef50bb504526153d87d8e0a7be0140 (diff) |
shugo's method etc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regex.h')
-rw-r--r-- | regex.h | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -182,11 +182,25 @@ extern long re_syntax_options; #undef ismbchar #define ismbchar(c) \ (re_syntax_options & RE_MBCTYPE_EUC \ - ? ((unsigned char) (c) >= 0x80) \ - : (re_syntax_options & RE_MBCTYPE_SJIS \ - ? (( 0x80 <= (unsigned char) (c) \ + ? ( 0xa1 <= (unsigned char) (c) \ + && (unsigned char) (c) <= 0xfe) \ + : (re_syntax_options & RE_MBCTYPE_SJIS \ + ? (( 0x81 <= (unsigned char) (c) \ && (unsigned char) (c) <= 0x9f) \ - || (0xe0 <= (unsigned char) (c))) \ + || ((0xe0 <= (unsigned char) (c)) \ + && (unsigned char) (c) <= 0xef)) \ + : 0)) + +#undef ismbchar2 +#define ismbchar2(c) \ + (re_syntax_options & RE_MBCTYPE_EUC \ + ? ( 0xa1 <= (unsigned char) (c) \ + && (unsigned char) (c) <= 0xfe) \ + : (re_syntax_options & RE_MBCTYPE_SJIS \ + ? (( 0x40 <= (unsigned char) (c) \ + && (unsigned char) (c) <= 0x7e) \ + || ((0x80 <= (unsigned char) (c)) \ + && (unsigned char) (c) <= 0xfc)) \ : 0)) /* This data structure is used to represent a compiled pattern. */ |