aboutsummaryrefslogtreecommitdiffstats
path: root/regparse.c
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-02 01:33:24 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-02 01:33:24 +0000
commit096d362939816b569b22ed3de87c06277ef4c3fb (patch)
treeb8d7245bcde48e41b278f11e1d678b611da7f517 /regparse.c
parentd359ee3f553c05949cacdd15efea07ea4a936435 (diff)
downloadruby-096d362939816b569b22ed3de87c06277ef4c3fb.tar.gz
add/change some comments in node_extended_grapheme_cluster() [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regparse.c')
-rw-r--r--regparse.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/regparse.c b/regparse.c
index 6152215279..fa562d3411 100644
--- a/regparse.c
+++ b/regparse.c
@@ -5839,8 +5839,10 @@ node_extended_grapheme_cluster(Node** np, ScanEnv* env)
OnigCodePoint sb_out = (ONIGENC_MBC_MINLEN(env->enc) > 1) ? 0x00 : 0x80;
if (propname2ctype(env, "Grapheme_Cluster_Break=Extend") < 0) goto err;
- /* main comment: The order of the code is mostly in reverse of the order
- * the various expressions appear in the grammar */
+ /* main comment: The order of the code is backwards (compared to the
+ * order the various expressions appear in the grammar)
+ * in the old-style parts. It is forwards in the new-style
+ * parts (in blocks ending with create_sequence_node()). */
/* Unicode 10.0.0 */
/* CRLF
* | Prepend*
@@ -6109,7 +6111,7 @@ node_extended_grapheme_cluster(Node** np, ScanEnv* env)
seq[3] = NULL_NODE;
R_ERR(create_sequence_node(&list2, seq));
- }
+ } /* End of ZWJ (E_Base_GAZ | Glue_After_Zwj) E_Modifier? */
tmp = onig_node_new_alt(list2, alt);
if (IS_NULL(tmp)) goto err;
@@ -6117,8 +6119,8 @@ node_extended_grapheme_cluster(Node** np, ScanEnv* env)
list2 = NULL;
/* Unicode 10.0.0/11.0.0 */
- /* this is actually Regional_Indicator+ in Unicode 10.0.0,
- * but it is Regional_Indicator{2} in Unicode 11.0.0, so no need to fix */
+ /* this is Regional_Indicator+ in the Unicode 10.0.0 regular expression,
+ * but the segmentation rules and Unicode 11.0.0 use Regional_Indicator{2}, so no need to fix */
/* RI-Sequence := Regional_Indicator{2} */
R_ERR(quantify_property_node(&np1, env, "Regional_Indicator", '2'));