[前][次][番号順一覧][スレッド一覧]

ruby-changes:42275

From: duerst <ko1@a...>
Date: Tue, 29 Mar 2016 13:31:03 +0900 (JST)
Subject: [ruby-changes:42275] duerst:r54349 (trunk): * enc/unicode.c: Cleaned up some comments.

duerst	2016-03-29 13:30:58 +0900 (Tue, 29 Mar 2016)

  New Revision: 54349

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54349

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

  Modified files:
    trunk/ChangeLog
    trunk/enc/unicode.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54348)
+++ ChangeLog	(revision 54349)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Mar 29 13:31:00 2016  Martin Duerst  <duerst@i...>
+
+	* enc/unicode.c: Cleaned up some comments.
+
 Tue Mar 29 13:24:56 2016  Martin Duerst  <duerst@i...>
 
 	* enc/unicode/case-folding.rb, casefold.h: Removing data for idempotent
Index: enc/unicode.c
===================================================================
--- enc/unicode.c	(revision 54348)
+++ enc/unicode.c	(revision 54349)
@@ -666,7 +666,6 @@ onigenc_unicode_case_map(OnigCaseFoldTyp https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L666
     to_end -= CASE_MAPPING_SLACK;
     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) {
 	code = ONIGENC_MBC_TO_CODE(enc, *pp, end);
 	*pp += enclen(enc, *pp, end);
@@ -704,9 +703,9 @@ onigenc_unicode_case_map(OnigCaseFoldTyp https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L703
 		}
 	    }
 	    else if ((folded = onigenc_unicode_fold_lookup(code)) != 0) { /* data about character found in CaseFold_11_Table */
-		if ((flags&ONIGENC_CASE_TITLECASE)                                 /* titlecase needed, */
-		    && (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_IS_TITLECASE)) { /* BUT alread titlecase  */
-		    /* already titlecase, no changes needed */
+		if ((flags&ONIGENC_CASE_TITLECASE)                                 /* Titlecase needed, */
+		    && (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_IS_TITLECASE)) { /* but alread Titlecase  */
+		    /* already Titlecase, no changes needed */
 		}
 		else if (flags&OnigCaseFoldFlags(folded->n)) { /* needs and data availability match */
 		    const OnigCodePoint *next;
@@ -716,8 +715,8 @@ onigenc_unicode_case_map(OnigCaseFoldTyp https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L715
 		    if (flags&OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_SPECIALS) { /* special */
 			OnigCodePoint *SpecialsStart = CaseMappingSpecials + OnigSpecialIndexDecode(folded->n);
 
-			if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_TITLECASE) { /* titlecase available */
-			    if (flags&ONIGENC_CASE_TITLECASE) /* titlecase needed, but not yet titlecase */
+			if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_TITLECASE) { /* Titlecase available */
+			    if (flags&ONIGENC_CASE_TITLECASE) /* Titlecase needed, but not yet Titlecase */
 				goto SpecialsCopy;
 			    else /* Titlecase not needed */
 				SpecialsStart += SpecialsLengthExtract(*SpecialsStart);
@@ -726,7 +725,7 @@ onigenc_unicode_case_map(OnigCaseFoldTyp https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L725
 			    if (!(flags&ONIGENC_CASE_DOWN_SPECIAL))
 				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:
 		        count = SpecialsLengthExtract(*SpecialsStart);
 			next = SpecialsStart;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]