From: K.Kosako Date: Mon, 21 Aug 2017 01:49:49 +0000 (+0900) Subject: add OP_EXTENDED_GRAPHEME_CLUSTER_BOUND and OP_NO_EXTENDED_GRAPHEME_CLUSTER_BOUND X-Git-Tag: v6.6.0~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e3ee80ca4a4b88444bbd1547d8baee258e024350;p=onig add OP_EXTENDED_GRAPHEME_CLUSTER_BOUND and OP_NO_EXTENDED_GRAPHEME_CLUSTER_BOUND --- diff --git a/src/regexec.c b/src/regexec.c index bb165b8..b5cea40 100644 --- a/src/regexec.c +++ b/src/regexec.c @@ -2264,6 +2264,24 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, break; #endif + case OP_EXTENDED_GRAPHEME_CLUSTER_BOUND: + MOP_IN(OP_EXTENDED_GRAPHEME_CLUSTER_BOUND); + if (onigenc_egcb_is_break_position(encode, s, sprev, str, end)) { + MOP_OUT; + continue; + } + goto fail; + break; + + case OP_NO_EXTENDED_GRAPHEME_CLUSTER_BOUND: + MOP_IN(OP_NO_EXTENDED_GRAPHEME_CLUSTER_BOUND); + if (onigenc_egcb_is_break_position(encode, s, sprev, str, end)) + goto fail; + + MOP_OUT; + continue; + break; + case OP_BEGIN_BUF: MOP_IN(OP_BEGIN_BUF); if (! ON_STR_BEGIN(s)) goto fail; diff --git a/src/regint.h b/src/regint.h index 43690f3..9b9214a 100644 --- a/src/regint.h +++ b/src/regint.h @@ -517,6 +517,9 @@ enum OpCode { OP_WORD_BEGIN, OP_WORD_END, + OP_EXTENDED_GRAPHEME_CLUSTER_BOUND, + OP_NO_EXTENDED_GRAPHEME_CLUSTER_BOUND, + OP_BEGIN_BUF, OP_END_BUF, OP_BEGIN_LINE,