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

ruby-changes:42236

From: duerst <ko1@a...>
Date: Mon, 28 Mar 2016 11:49:26 +0900 (JST)
Subject: [ruby-changes:42236] duerst:r54310 (trunk): * enc/unicode.c: Adding comments. [ci skip]

duerst	2016-03-28 11:49:20 +0900 (Mon, 28 Mar 2016)

  New Revision: 54310

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

  Log:
    * enc/unicode.c: Adding comments. [ci skip]

  Modified files:
    trunk/ChangeLog
    trunk/enc/unicode.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54309)
+++ ChangeLog	(revision 54310)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Mar 28 11:49:21 2016  Martin Duerst  <duerst@i...>
+
+	* enc/unicode.c: Adding comments. [ci skip]
+
 Mon Mar 28 11:30:23 2016  Shinichi Maeshima  <netwillnet@g...>
 
 	* lib/rubygems.rb: Fix `Gem.find_spec_for_exe` picks oldest gem.
Index: enc/unicode.c
===================================================================
--- enc/unicode.c	(revision 54309)
+++ enc/unicode.c	(revision 54310)
@@ -710,22 +710,22 @@ onigenc_unicode_case_map(OnigCaseFoldTyp https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L710
 	    else if (code==DOTLESS_i && (flags&ONIGENC_CASE_UPCASE)) {
 		code = 'I'; MODIFIED;
 	    }
-	    else if ((folded = onigenc_unicode_fold_lookup(code)) != 0) {
+	    else if ((folded = onigenc_unicode_fold_lookup(code)) != 0) { /* data about character found in CaseFold_11_Table */
 		if (flags&OnigCaseFoldFlags(folded->n)) {
 		    const OnigCodePoint *next;
 		    int count;
 
 		    MODIFIED;
-		    if (flags&OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_SPECIALS) {
+		    if (flags&OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_SPECIALS) { /* special */
 			OnigCodePoint *SpecialsStart = CaseMappingSpecials + OnigSpecialIndexDecode(folded->n);
 
-			if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_TITLECASE) {
-			    if (flags&ONIGENC_CASE_TITLECASE) {
-				if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_IS_TITLECASE)
+			if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_TITLECASE) { /* Titlecase available */
+			    if (flags&ONIGENC_CASE_TITLECASE) { /* titlecase needed */
+				if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_IS_TITLECASE) /* alread titlecase */
 				    flags ^= ONIGENC_CASE_MODIFIED;
 				goto SpecialsCopy;
 			    }
-			    else
+			    else /* Titlecase not needed */
 				SpecialsStart += SpecialsLengthExtract(*SpecialsStart);
 			}
 			if (OnigCaseFoldFlags(folded->n)&ONIGENC_CASE_DOWN_SPECIAL) {
@@ -756,7 +756,7 @@ onigenc_unicode_case_map(OnigCaseFoldTyp https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L756
 		    }
 		}
 	    }
-	    else if ((folded = onigenc_unicode_unfold1_lookup(code)) != 0) {
+	    else if ((folded = onigenc_unicode_unfold1_lookup(code)) != 0) {  /* data about character found in CaseUnfold_11_Table */
 		if (flags&OnigCaseFoldFlags(folded->n)) {
 		    int count = OnigCodePointCount(folded->n);
 		    const OnigCodePoint *next = folded->code;

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

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