1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* include/ruby/oniguruma.h: Extend OnigEncodingTypeDefine to define a

new encoding primitive 'case_map' for case mapping
* enc/utf-8.c, utf_16be/le.c, utf_32be/le.c:
  add onigenc_unicode_case_map as case_map primitive
* enc/ascii.c, big5.c, cp949.c, emacs_mule.c, euc_jp/kr/tw.c, gb18030.c,
  gbk.c, iso_8859_1/2/3/4/5/6/7/8/9/10/11/13/14/15/16.c, koi8_r/u.c,
  shift_jis.c, us_ascii.c, windows_1250/1251/1252.c:
  add onigenc_not_support_case_map as case_map primitive


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
duerst 2016-05-22 05:57:44 +00:00
parent 14b524b6b0
commit 78c5ca7074
39 changed files with 133 additions and 0 deletions

View file

@ -1,3 +1,16 @@
Sun May 22 14:57:43 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
* include/ruby/oniguruma.h: Extend OnigEncodingTypeDefine to define a
new encoding primitive 'case_map' for case mapping
* enc/utf-8.c, utf_16be/le.c, utf_32be/le.c:
add onigenc_unicode_case_map as case_map primitive
* enc/ascii.c, big5.c, cp949.c, emacs_mule.c, euc_jp/kr/tw.c, gb18030.c,
gbk.c, iso_8859_1/2/3/4/5/6/7/8/9/10/11/13/14/15/16.c, koi8_r/u.c,
shift_jis.c, us_ascii.c, windows_1250/1251/1252.c:
add onigenc_not_support_case_map as case_map primitive
Sun May 22 14:45:45 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
* regenc.h/c: Define new function onigenc_not_support_case_map

View file

@ -53,6 +53,9 @@ OnigEncodingDefine(ascii, ASCII) = {
onigenc_always_true_is_allowed_reverse_match,
ENCINDEX_ASCII,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("BINARY", "ASCII-8BIT")
ENC_REPLICATE("IBM437", "ASCII-8BIT")

View file

@ -302,6 +302,9 @@ OnigEncodingDefine(big5, BIG5) = {
big5_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
/*
@ -336,6 +339,9 @@ OnigEncodingDefine(big5_hkscs, BIG5_HKSCS) = {
big5_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("Big5-HKSCS:2008", "Big5-HKSCS")
@ -370,4 +376,7 @@ OnigEncodingDefine(big5_uao, BIG5_UAO) = {
big5_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};

View file

@ -213,6 +213,9 @@ OnigEncodingDefine(cp949, CP949) = {
cp949_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
/*
* Name: CP949

View file

@ -336,6 +336,9 @@ OnigEncodingDefine(emacs_mule, Emacs_Mule) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_REPLICATE("stateless-ISO-2022-JP", "Emacs-Mule")

View file

@ -578,6 +578,9 @@ OnigEncodingDefine(euc_jp, EUC_JP) = {
is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
/*
* Name: EUC-JP

View file

@ -190,5 +190,8 @@ OnigEncodingDefine(euc_kr, EUC_KR) = {
euckr_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("eucKR", "EUC-KR")

View file

@ -223,5 +223,8 @@ OnigEncodingDefine(euc_tw, EUC_TW) = {
euctw_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("eucTW", "EUC-TW")

View file

@ -599,5 +599,8 @@ OnigEncodingDefine(gb18030, GB18030) = {
gb18030_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};

View file

@ -213,6 +213,9 @@ OnigEncodingDefine(gbk, GBK) = {
gbk_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
/*
* Name: GBK

View file

@ -273,5 +273,8 @@ OnigEncodingDefine(iso_8859_1, ISO_8859_1) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-1", "ISO-8859-1")

View file

@ -242,5 +242,8 @@ OnigEncodingDefine(iso_8859_10, ISO_8859_10) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-10", "ISO-8859-10")

View file

@ -95,6 +95,9 @@ OnigEncodingDefine(iso_8859_11, ISO_8859_11) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-11", "ISO-8859-11")

View file

@ -235,6 +235,9 @@ OnigEncodingDefine(iso_8859_13, ISO_8859_13) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-13", "ISO-8859-13")

View file

@ -244,5 +244,8 @@ OnigEncodingDefine(iso_8859_14, ISO_8859_14) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-14", "ISO-8859-14")

View file

@ -238,5 +238,8 @@ OnigEncodingDefine(iso_8859_15, ISO_8859_15) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-15", "ISO-8859-15")

View file

@ -240,5 +240,8 @@ OnigEncodingDefine(iso_8859_16, ISO_8859_16) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-16", "ISO-8859-16")

View file

@ -238,5 +238,8 @@ OnigEncodingDefine(iso_8859_2, ISO_8859_2) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-2", "ISO-8859-2")

View file

@ -238,5 +238,8 @@ OnigEncodingDefine(iso_8859_3, ISO_8859_3) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-3", "ISO-8859-3")

View file

@ -241,5 +241,8 @@ OnigEncodingDefine(iso_8859_4, ISO_8859_4) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-4", "ISO-8859-4")

View file

@ -228,5 +228,8 @@ OnigEncodingDefine(iso_8859_5, ISO_8859_5) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-5", "ISO-8859-5")

View file

@ -95,6 +95,9 @@ OnigEncodingDefine(iso_8859_6, ISO_8859_6) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-6", "ISO-8859-6")

View file

@ -225,6 +225,9 @@ OnigEncodingDefine(iso_8859_7, ISO_8859_7) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-7", "ISO-8859-7")

View file

@ -95,6 +95,9 @@ OnigEncodingDefine(iso_8859_8, ISO_8859_8) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-8", "ISO-8859-8")

View file

@ -231,6 +231,9 @@ OnigEncodingDefine(iso_8859_9, ISO_8859_9) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ISO8859-9", "ISO-8859-9")

View file

@ -216,6 +216,9 @@ OnigEncodingDefine(koi8_r, KOI8_R) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("CP878", "KOI8-R")

View file

@ -220,4 +220,7 @@ OnigEncodingDefine(koi8_u, KOI8_U) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};

View file

@ -565,6 +565,9 @@ OnigEncodingDefine(shift_jis, Shift_JIS) = {
is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
/*
* Name: Shift_JIS

View file

@ -31,6 +31,9 @@ OnigEncodingDefine(us_ascii, US_ASCII) = {
onigenc_always_true_is_allowed_reverse_match,
ENCINDEX_US_ASCII,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("ASCII", "US-ASCII")
ENC_ALIAS("ANSI_X3.4-1968", "US-ASCII")

View file

@ -250,5 +250,8 @@ OnigEncodingDefine(utf_16be, UTF_16BE) = {
onigenc_always_false_is_allowed_reverse_match,
0,
ONIGENC_FLAG_UNICODE,
#ifdef ONIG_CASE_MAPPING
onigenc_unicode_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("UCS-2BE", "UTF-16BE")

View file

@ -243,4 +243,7 @@ OnigEncodingDefine(utf_16le, UTF_16LE) = {
onigenc_always_false_is_allowed_reverse_match,
0,
ONIGENC_FLAG_UNICODE,
#ifdef ONIG_CASE_MAPPING
onigenc_unicode_case_map,
#endif /* ONIG_CASE_MAPPING */
};

View file

@ -188,6 +188,9 @@ OnigEncodingDefine(utf_32be, UTF_32BE) = {
onigenc_always_false_is_allowed_reverse_match,
0,
ONIGENC_FLAG_UNICODE,
#ifdef ONIG_CASE_MAPPING
onigenc_unicode_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("UCS-4BE", "UTF-32BE")

View file

@ -188,5 +188,8 @@ OnigEncodingDefine(utf_32le, UTF_32LE) = {
onigenc_always_false_is_allowed_reverse_match,
0,
ONIGENC_FLAG_UNICODE,
#ifdef ONIG_CASE_MAPPING
onigenc_unicode_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("UCS-4LE", "UTF-32LE")

View file

@ -430,6 +430,9 @@ OnigEncodingDefine(utf_8, UTF_8) = {
onigenc_always_true_is_allowed_reverse_match,
ENCINDEX_UTF_8,
ONIGENC_FLAG_UNICODE,
#ifdef ONIG_CASE_MAPPING
onigenc_unicode_case_map,
#endif /* ONIG_CASE_MAPPING */
};
ENC_ALIAS("CP65001", "UTF-8")

View file

@ -208,6 +208,9 @@ OnigEncodingDefine(windows_1250, Windows_1250) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
/*
* Name: windows-1250

View file

@ -199,6 +199,9 @@ OnigEncodingDefine(windows_1251, Windows_1251) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
/*
* Name: windows-1251

View file

@ -200,6 +200,9 @@ OnigEncodingDefine(windows_1252, Windows_1252) = {
onigenc_always_true_is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
/*
* Name: windows-1252

View file

@ -50,6 +50,9 @@ OnigEncodingDefine(windows_31j, Windows_31J) = {
is_allowed_reverse_match,
0,
ONIGENC_FLAG_NONE,
#ifdef ONIG_CASE_MAPPING
onigenc_not_support_case_map,
#endif /* ONIG_CASE_MAPPING */
};
/*
* Name: Windows-31J

View file

@ -216,6 +216,9 @@ typedef struct OnigEncodingTypeST {
int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc);
int ruby_encoding_index;
unsigned int flags;
#ifdef ONIG_CASE_MAPPING
int (*case_map)(OnigCaseFoldType* flagP, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, OnigUChar* to_end, const struct OnigEncodingTypeST* enc);
#endif /* ONIG_CASE_MAPPING */
} OnigEncodingType;
typedef const OnigEncodingType* OnigEncoding;