ruby-changes:53845
From: duerst <ko1@a...>
Date: Wed, 28 Nov 2018 10:58:40 +0900 (JST)
Subject: [ruby-changes:53845] duerst:r66063 (trunk): use create_sequence_node() once more
duerst 2018-11-28 10:58:35 +0900 (Wed, 28 Nov 2018) New Revision: 66063 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66063 Log: use create_sequence_node() once more One more use of create_sequence_node() in node_extended_grapheme_cluster (several more to come). Modified files: trunk/regparse.c Index: regparse.c =================================================================== --- regparse.c (revision 66062) +++ regparse.c (revision 66063) @@ -5968,28 +5968,18 @@ node_extended_grapheme_cluster(Node** np https://github.com/ruby/ruby/blob/trunk/regparse.c#L5968 /* 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; - - 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; + /* 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", '?')); + + 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/