]> granicus.if.org Git - onig/commitdiff
use (*ONLY(n)) in sample/callout.c
authorK.Kosako <kosako@sofnec.co.jp>
Tue, 27 Feb 2018 04:16:46 +0000 (13:16 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Tue, 27 Feb 2018 04:16:46 +0000 (13:16 +0900)
sample/callout.c

index c160c9412a339134ebefddf1aeff9dc87233df65..0fd20305ccb262080a49827ea0ea46f97b536889 100644 (file)
@@ -232,7 +232,6 @@ extern int main(int argc, char* argv[])
   (void)onig_set_callout_of_contents(progress_callout_func);
   (void)onig_set_retraction_callout_of_contents(retraction_callout_func);
 
-
   // callout of code
   test("a+(?{foo bar baz...}+)$", "aaab");
   test("(?{{!{}#$%&'()=-~^|[_]`@*:+;<>?/.\\,}})c", "abc");
@@ -250,6 +249,10 @@ extern int main(int argc, char* argv[])
   test("abc(d|(*ERROR(-999)))", "abc");
   test("ab(*bar(372,I am a bar's argument,あ))c(*FAIL)", "abc");
   test("ab(*bar(1234567890))", "abc");
+  test("(?:a(*ONLY(2))|b)*", "abbabbabbabb");
+  test("(?:(*ONLY(2))a|b)*", "abbabbabbabb");
+  test("(?:(*ONLY)a|b)*", "bbbbbabbbbbabbbbb");
+  test("(?:(*ONLY(3))a|(*ONLY(4))b)*", "bbbaabbab");
 
   onig_end();
   return 0;