mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
remove unnecessary code removing CR/LF from range
Remove code that tries to remove CR and LF from Grapheme_Cluster_Break=Control. This code is unnecessary because Grapheme_Cluster_Break=Control already excludes CR and LF. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
36b3e41a57
commit
d1f8694171
1 changed files with 1 additions and 16 deletions
17
regparse.c
17
regparse.c
|
@ -5878,22 +5878,7 @@ node_extended_grapheme_cluster(Node** np, ScanEnv* env)
|
||||||
if (IS_NULL(np1)) goto err;
|
if (IS_NULL(np1)) goto err;
|
||||||
cc = NCCLASS(np1);
|
cc = NCCLASS(np1);
|
||||||
R_ERR(add_property_to_cc(cc, "Grapheme_Cluster_Break=Control", 1, env));
|
R_ERR(add_property_to_cc(cc, "Grapheme_Cluster_Break=Control", 1, env));
|
||||||
if (ONIGENC_MBC_MINLEN(env->enc) > 1) {
|
if (! (ONIGENC_MBC_MINLEN(env->enc) > 1)) {
|
||||||
BBuf *pbuf2 = NULL;
|
|
||||||
R_ERR(add_code_range(&pbuf1, env, 0x0a, 0x0a));
|
|
||||||
R_ERR(add_code_range(&pbuf1, env, 0x0d, 0x0d));
|
|
||||||
if (r != 0) goto err;
|
|
||||||
r = and_code_range_buf(cc->mbuf, 0, pbuf1, 1, &pbuf2, env);
|
|
||||||
if (r != 0) {
|
|
||||||
bbuf_free(pbuf2);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
bbuf_free(pbuf1);
|
|
||||||
pbuf1 = NULL;
|
|
||||||
bbuf_free(cc->mbuf);
|
|
||||||
cc->mbuf = pbuf2;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
BITSET_CLEAR_BIT(cc->bs, 0x0a);
|
BITSET_CLEAR_BIT(cc->bs, 0x0a);
|
||||||
BITSET_CLEAR_BIT(cc->bs, 0x0d);
|
BITSET_CLEAR_BIT(cc->bs, 0x0d);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue