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

* enc/unicode.c: Cleaned up some comments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
duerst 2016-03-29 04:30:58 +00:00
parent 0e6f8b166d
commit 49f25a1299
2 changed files with 10 additions and 7 deletions

View file

@ -1,3 +1,7 @@
Tue Mar 29 13:31:00 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
* enc/unicode.c: Cleaned up some comments.
Tue Mar 29 13:24:56 2016 Martin Duerst <duerst@it.aoyama.ac.jp> Tue Mar 29 13:24:56 2016 Martin Duerst <duerst@it.aoyama.ac.jp>
* enc/unicode/case-folding.rb, casefold.h: Removing data for idempotent * enc/unicode/case-folding.rb, casefold.h: Removing data for idempotent

View file

@ -666,7 +666,6 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP,
to_end -= CASE_MAPPING_SLACK; to_end -= CASE_MAPPING_SLACK;
flags |= (flags&(ONIGENC_CASE_UPCASE|ONIGENC_CASE_DOWNCASE))<<ONIGENC_CASE_SPECIAL_OFFSET; flags |= (flags&(ONIGENC_CASE_UPCASE|ONIGENC_CASE_DOWNCASE))<<ONIGENC_CASE_SPECIAL_OFFSET;
/* hopelessly preliminary implementation, just dealing with ASCII and Turkic */
while (*pp<end && to<=to_end) { while (*pp<end && to<=to_end) {
code = ONIGENC_MBC_TO_CODE(enc, *pp, end); code = ONIGENC_MBC_TO_CODE(enc, *pp, end);
*pp += enclen(enc, *pp, end); *pp += enclen(enc, *pp, end);
@ -704,9 +703,9 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP,
} }
} }
else if ((folded = onigenc_unicode_fold_lookup(code)) != 0) { /* data about character found in CaseFold_11_Table */ else if ((folded = onigenc_unicode_fold_lookup(code)) != 0) { /* data about character found in CaseFold_11_Table */
if ((flags&ONIGENC_CASE_TITLECASE) /* titlecase needed, */ if ((flags&ONIGENC_CASE_TITLECASE) /* Titlecase needed, */
&& (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_IS_TITLECASE)) { /* BUT alread titlecase */ && (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_IS_TITLECASE)) { /* but alread Titlecase */
/* already titlecase, no changes needed */ /* already Titlecase, no changes needed */
} }
else if (flags&OnigCaseFoldFlags(folded->n)) { /* needs and data availability match */ else if (flags&OnigCaseFoldFlags(folded->n)) { /* needs and data availability match */
const OnigCodePoint *next; const OnigCodePoint *next;
@ -716,8 +715,8 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP,
if (flags&OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_SPECIALS) { /* special */ if (flags&OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_SPECIALS) { /* special */
OnigCodePoint *SpecialsStart = CaseMappingSpecials + OnigSpecialIndexDecode(folded->n); OnigCodePoint *SpecialsStart = CaseMappingSpecials + OnigSpecialIndexDecode(folded->n);
if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_TITLECASE) { /* titlecase available */ if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_TITLECASE) { /* Titlecase available */
if (flags&ONIGENC_CASE_TITLECASE) /* titlecase needed, but not yet titlecase */ if (flags&ONIGENC_CASE_TITLECASE) /* Titlecase needed, but not yet Titlecase */
goto SpecialsCopy; goto SpecialsCopy;
else /* Titlecase not needed */ else /* Titlecase not needed */
SpecialsStart += SpecialsLengthExtract(*SpecialsStart); SpecialsStart += SpecialsLengthExtract(*SpecialsStart);
@ -726,7 +725,7 @@ onigenc_unicode_case_map(OnigCaseFoldType* flagP,
if (!(flags&ONIGENC_CASE_DOWN_SPECIAL)) if (!(flags&ONIGENC_CASE_DOWN_SPECIAL))
SpecialsStart += SpecialsLengthExtract(*SpecialsStart); SpecialsStart += SpecialsLengthExtract(*SpecialsStart);
} }
/* if we pass here, we know we use special upcasing, and are at the right position */ /* here, we know we use ONIGENC_CASE_UP_SPECIAL, and the position is right */
SpecialsCopy: SpecialsCopy:
count = SpecialsLengthExtract(*SpecialsStart); count = SpecialsLengthExtract(*SpecialsStart);
next = SpecialsStart; next = SpecialsStart;