]> granicus.if.org Git - onig/commitdiff
add descriptions about OnigRegSet values
authorK.Kosako <kosako@sofnec.co.jp>
Mon, 30 Sep 2019 02:27:22 +0000 (11:27 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Mon, 30 Sep 2019 02:27:22 +0000 (11:27 +0900)
doc/API
doc/API.ja

diff --git a/doc/API b/doc/API
index 1a0910fd826019423a710b8f563f8b9bceaaa4c8..5580754375f7c2635cd121e9caccbb50f6bb66cd 100644 (file)
--- a/doc/API
+++ b/doc/API
@@ -1,4 +1,4 @@
-Oniguruma API  Version 6.9.4  2019/09/25
+Oniguruma API  Version 6.9.4  2019/09/30
 
 #include <oniguruma.h>
 
@@ -469,12 +469,19 @@ Oniguruma API  Version 6.9.4  2019/09/25
   3 end:    terminate address of target string
   4 start:  search start address of target string
   5 range:  search terminate address of target string
-  6 lead:   outer loop element (ONIG_REGSET_POSITION_LEAD or ONIG_REGSET_REGEX_LEAD)
+  6 lead:   outer loop element
+      ONIG_REGSET_POSITION_LEAD (returns most left position)
+      ONIG_REGSET_REGEX_LEAD    (returns most left position)
+      ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex)
   7 option: search time option
       ONIG_OPTION_NOTBOL    string head(str) isn't considered as begin of line
       ONIG_OPTION_NOTEOL    string end (end) isn't considered as end of line
   8 rmatch_pos: return address of match position (match_address - str)
 
+  * ONIG_REGSET_POSITION_LEAD and ONIG_REGSET_REGEX_LEAD return the same result.
+    These differences only appear in search time.
+    In most cases, ONIG_REGSET_POSITION_LEAD seems to be faster.
+
 
 # int onig_regset_search_with_param(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range,  OnigRegSetLead lead, OnigOptionType option, OnigMatchParam* mps[], int* rmatch_pos)
 
@@ -491,7 +498,10 @@ Oniguruma API  Version 6.9.4  2019/09/25
   3 end:    terminate address of target string
   4 start:  search start address of target string
   5 range:  search terminate address of target string
-  6 lead:   outer loop element (ONIG_REGSET_POSITION_LEAD or ONIG_REGSET_REGEX_LEAD)
+  6 lead:   outer loop element
+      ONIG_REGSET_POSITION_LEAD (returns most left position)
+      ONIG_REGSET_REGEX_LEAD    (returns most left position)
+      ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (returns first match regex)
   7 option: search time option
       ONIG_OPTION_NOTBOL    string head(str) isn't considered as begin of line
       ONIG_OPTION_NOTEOL    string end (end) isn't considered as end of line
index 950c2a146252079752f0c0409fa99e3035d22bf6..a1b56c7d10e44352ea0d07104e3f3ed6a35608f3 100644 (file)
@@ -1,4 +1,4 @@
-鬼車インターフェース Version 6.9.4   2019/09/25
+鬼車インターフェース Version 6.9.4   2019/09/30
 
 #include <oniguruma.h>
 
   4 start:  検索対象文字列の検索先頭位置アドレス
   5 range:  検索対象文字列の検索終了位置アドレス
             (start <= 探索される文字列 < range)
-  6 lead:   外側のループ要素 (ONIG_REGSET_POSITION_LEAD or ONIG_REGSET_REGEX_LEAD)
+  6 lead:   外側のループ要素
+    ONIG_REGSET_POSITION_LEAD   (最左位置でマッチした結果を返す)
+    ONIG_REGSET_REGEX_LEAD      (最左位置でマッチした結果を返す)
+    ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (最初にマッチした正規表現の結果を返す)
   7 option: 検索時オプション
     ONIG_OPTION_NOTBOL        文字列の先頭(str)を行頭と看做さない
     ONIG_OPTION_NOTEOL        文字列の終端(end)を行末と看做さない
   8 rmatch_pos: マッチした位置を返すためのアドレス (match_address - str)
 
+  * ONIG_REGSET_POSITION_LEADとONIG_REGSET_REGEX_LEADは同じ結果を返す。
+    これらの違いは検索時間にしか現れない。
+    ほとんどの場合、ONIG_REGSET_POSITION_LEADのほうが速いと思われる。
+
 
 # int onig_regset_search_with_param(OnigRegSet* set, const OnigUChar* str, const OnigUChar* end, const OnigUChar* start, const OnigUChar* range,  OnigRegSetLead lead, OnigOptionType option, OnigMatchParam* mps[], int* rmatch_pos)
 
   4 start:  検索対象文字列の検索先頭位置アドレス
   5 range:  検索対象文字列の検索終了位置アドレス
             (start <= 探索される文字列 < range)
-  6 lead:   外側のループ要素 (ONIG_REGSET_POSITION_LEAD or ONIG_REGSET_REGEX_LEAD)
+  6 lead:   外側のループ要素
+    ONIG_REGSET_POSITION_LEAD   (最左位置でマッチした結果を返す)
+    ONIG_REGSET_REGEX_LEAD      (最左位置でマッチした結果を返す)
+    ONIG_REGSET_PRIORITY_TO_REGEX_ORDER (最初にマッチした正規表現の結果を返す)
   7 option: 検索時オプション
     ONIG_OPTION_NOTBOL        文字列の先頭(str)を行頭と看做さない
     ONIG_OPTION_NOTEOL        文字列の終端(end)を行末と看做さない