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

use explicit property name when creating nodes for "Grapheme_Cluster_Break=Extend"

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
duerst 2018-11-27 04:13:21 +00:00
parent b62e466fb5
commit aa44935969

View file

@ -5757,9 +5757,8 @@ node_extended_grapheme_cluster(Node** np, ScanEnv* env)
/* UTF-8, UTF-16BE/LE, UTF-32BE/LE */
CClassNode* cc;
OnigCodePoint sb_out = (ONIGENC_MBC_MINLEN(env->enc) > 1) ? 0x00 : 0x80;
int extend = propname2ctype(env, "Grapheme_Cluster_Break=Extend");
if (extend < 0) goto err;
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 */
/* Unicode 10.0.0 */
@ -5771,11 +5770,10 @@ node_extended_grapheme_cluster(Node** np, ScanEnv* env)
/* Unicode 10.0.0 */
/* ( Grapheme_Extend | SpacingMark )* */
np1 = node_new_cclass();
if (IS_NULL(np1)) goto err;
cc = NCCLASS(np1);
r = add_ctype_to_cc(cc, extend, 0, 0, env);
r = create_property_node(&np1, env, "Grapheme_Cluster_Break=Extend");
if (r != 0) goto err;
cc = NCCLASS(np1);
r = add_property_to_cc(cc, "Grapheme_Cluster_Break=SpacingMark", 0, env);
if (r != 0) goto err;
r = add_code_range(&(cc->mbuf), env, 0x200D, 0x200D);
@ -6024,10 +6022,7 @@ node_extended_grapheme_cluster(Node** np, ScanEnv* env)
list2 = tmp;
np1 = NULL;
np1 = node_new_cclass();
if (IS_NULL(np1)) goto err;
cc = NCCLASS(np1);
r = add_ctype_to_cc(cc, extend, 0, 0, env);
r = create_property_node(&np1, env, "Grapheme_Cluster_Break=Extend");
if (r != 0) goto err;
tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
@ -6055,10 +6050,7 @@ node_extended_grapheme_cluster(Node** np, ScanEnv* env)
/* Unicode 10.0.0 */
/* Glue_After_Zwj */
np1 = node_new_cclass();
if (IS_NULL(np1)) goto err;
cc = NCCLASS(np1);
r = add_ctype_to_cc(cc, extend, 0, 0, env);
r = create_property_node(&np1, env, "Grapheme_Cluster_Break=Extend");
if (r != 0) goto err;
tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);
@ -6172,10 +6164,7 @@ node_extended_grapheme_cluster(Node** np, ScanEnv* env)
np1 = NULL;
/* Extend* */
np1 = node_new_cclass();
if (IS_NULL(np1)) goto err;
cc = NCCLASS(np1);
r = add_ctype_to_cc(cc, extend, 0, 0, env);
r = create_property_node(&np1, env, "Grapheme_Cluster_Break=Extend");
if (r != 0) goto err;
tmp = node_new_quantifier(0, REPEAT_INFINITE, 0);