summaryrefslogtreecommitdiff
path: root/regex.h
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-03 10:16:14 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-03 10:16:14 +0000
commit369124b0ec6aa0d58ea628339713444c559bfa5f (patch)
tree69b7aaee156382355dbde6cd1302bb73d2e3e6c9 /regex.h
parent0861165bdcef50bb504526153d87d8e0a7be0140 (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.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/regex.h b/regex.h
index 91442a8..bf35589 100644
--- a/regex.h
+++ b/regex.h
@@ -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. */