From b4e39021f20afeb03a03a02d1ffd47adaed3cd6b Mon Sep 17 00:00:00 2001 From: duerst Date: Wed, 28 Nov 2018 01:58:35 +0000 Subject: [PATCH] use create_sequence_node() once more One more use of create_sequence_node() in node_extended_grapheme_cluster (several more to come). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- regparse.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/regparse.c b/regparse.c index abb494ccf8..48e5f511e3 100644 --- a/regparse.c +++ b/regparse.c @@ -5968,28 +5968,18 @@ node_extended_grapheme_cluster(Node** np, ScanEnv* env) /* Unicode 10.0.0 */ /* Emoji sequence := (E_Base | EBG) Extend* E_Modifier? * (ZWJ (Glue_After_Zwj | EBG Extend* E_Modifier?) )* */ - /* ZWJ (Glue_After_Zwj | E_Base_GAZ Extend* E_Modifier?) */ - R_ERR(quantify_property_node(&np1, env, "Grapheme_Cluster_Break=E_Modifier", '?')); - tmp = node_new_list(np1, NULL_NODE); - if (IS_NULL(tmp)) goto err; - list2 = tmp; - np1 = NULL; + /* E_Base_GAZ Extend* E_Modifier? */ + { + Node* seq[4]; + R_ERR(create_property_node(seq+0, env, "Grapheme_Cluster_Break=E_Base_GAZ")); + R_ERR(quantify_property_node(seq+1, env, "Grapheme_Cluster_Break=Extend", '*')); + R_ERR(quantify_property_node(seq+2, env, "Grapheme_Cluster_Break=E_Modifier", '?')); - R_ERR(quantify_property_node(&np1, env, "Grapheme_Cluster_Break=Extend", '*')); - - tmp = node_new_list(np1, list2); - if (IS_NULL(tmp)) goto err; - list2 = tmp; - np1 = NULL; - - R_ERR(create_property_node(&np1, env, "Grapheme_Cluster_Break=E_Base_GAZ")); - - tmp = node_new_list(np1, list2); - if (IS_NULL(tmp)) goto err; - list2 = tmp; - np1 = NULL; + seq[3] = NULL_NODE; + R_ERR(create_sequence_node(&list2, seq)); + } tmp = onig_node_new_alt(list2, NULL_NODE); if (IS_NULL(tmp)) goto err;