diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-15 16:01:33 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-15 16:01:33 +0000 |
commit | bd78259daaffb26a129dcd6bde3c6cb97c869775 (patch) | |
tree | eb1ced08dceb7c9a24a50a630b15fdf4042de0d9 /include/ruby | |
parent | ec7015dac33abc22fafe603e4f49f465f9e6e58d (diff) | |
download | ruby-bd78259daaffb26a129dcd6bde3c6cb97c869775.tar.gz ruby-bd78259daaffb26a129dcd6bde3c6cb97c869775.tar.xz ruby-bd78259daaffb26a129dcd6bde3c6cb97c869775.zip |
\d, \s and \w are now non Unicode class. [ruby-dev:39026]
* include/ruby/oniguruma.h
(ONIGENC_CTYPE_SPECIAL_MASK): added.
(ONIGENC_CTYPE_D): ditto.
(ONIGENC_CTYPE_S): ditto.
(ONIGENC_CTYPE_W): ditto.
* regparse.c: \d, \s and \w are now non Unicode class.
[ruby-dev:39026]
(fetch_token_in_cc): use ONIGENC_CTYPE_[DSW] for \d/\s/\w.
(fetch_token): ditto.
(add_ctype_to_cc): add routines for ONIGENC_CTYPE_[DSW].
(parse_exp): ditto.
* test/ruby/test_regexp.rb (TestRegexp#test_char_class):
add tests for above.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-rw-r--r-- | include/ruby/oniguruma.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/ruby/oniguruma.h b/include/ruby/oniguruma.h index 00b299915..52f0c687e 100644 --- a/include/ruby/oniguruma.h +++ b/include/ruby/oniguruma.h @@ -200,6 +200,14 @@ ONIG_EXTERN OnigEncodingType OnigEncodingASCII; #define ONIGENC_CTYPE_ALNUM 13 /* alpha || digit */ #define ONIGENC_CTYPE_ASCII 14 #define ONIGENC_MAX_STD_CTYPE ONIGENC_CTYPE_ASCII +#define ONIGENC_CTYPE_SPECIAL_MASK 128 +#define ONIGENC_CTYPE_S /* [\t\n\v\f\r\s] */ \ + ONIGENC_CTYPE_SPECIAL_MASK | ONIGENC_CTYPE_SPACE +#define ONIGENC_CTYPE_D /* [0-9] */ \ + ONIGENC_CTYPE_SPECIAL_MASK | ONIGENC_CTYPE_DIGIT +#define ONIGENC_CTYPE_W /* [0-9A-Za-z_] */ \ + ONIGENC_CTYPE_SPECIAL_MASK | ONIGENC_CTYPE_WORD +#define ONIGENC_CTYPE_SPECIAL_P(ctype) ((ctype) & ONIGENC_CTYPE_SPECIAL_MASK) #define onig_enc_len(enc,p,e) ONIGENC_MBC_ENC_LEN(enc, p, e) |