summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2022-12-19 10:28:51 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2022-12-19 11:05:55 +0900
commit47a6e7b518bf5bebd293519ee89b77c06830f21d (patch)
tree374c7c996ebffbffb6453edbbad16c9628ce8ac7 /re.c
parente123695fbccb36e804f5d386a23fd3968b60b825 (diff)
downloadruby-47a6e7b518bf5bebd293519ee89b77c06830f21d.tar.gz
Note about Regexp.linera_time? [ci skip]
Diffstat (limited to 're.c')
-rw-r--r--re.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/re.c b/re.c
index 6c60b5875f..cd0b96b9f9 100644
--- a/re.c
+++ b/re.c
@@ -4204,6 +4204,16 @@ rb_reg_s_union_m(VALUE self, VALUE args)
*
* Regexp.linear_time?(/re/) # => true
*
+ * Note that this is a property of the ruby interpreter, not of the argument
+ * regular expression. Identical regexp can or cannot run in linear time
+ * depending on your ruby binary. Neither forward nor backward compatibility
+ * is guaranteed about the return value of this method. Our current algorithm
+ * is (*1) but this is subject to change in the future. Alternative
+ * implementations can also behave differently. They might always return
+ * false of everything.
+ *
+ * (*1): https://doi.org/10.1109/SP40001.2021.00032
+ *
*/
static VALUE
rb_reg_s_linear_time_p(int argc, VALUE *argv, VALUE self)