]> granicus.if.org Git - onig/commitdiff
add OP_EXTENDED_GRAPHEME_CLUSTER_BOUND and OP_NO_EXTENDED_GRAPHEME_CLUSTER_BOUND
authorK.Kosako <kosako@sofnec.co.jp>
Mon, 21 Aug 2017 01:49:49 +0000 (10:49 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Mon, 21 Aug 2017 01:49:49 +0000 (10:49 +0900)
src/regexec.c
src/regint.h

index bb165b8a7a3771884f3c5dc81c4c996635684177..b5cea40f25be3403aa78368658d33250335e4261 100644 (file)
@@ -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;
 
index 43690f38e173c6c8f952b1b9137e60f69829ba9b..9b9214a11a18f5e257bf080c3e01ebd9dbe6cf4e 100644 (file)
@@ -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,