summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/common.ml
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-10-01 12:01:00 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-10-01 12:01:00 +0000
commit19ec25715ed9df4a57e553b255c736bcc9cd40ac (patch)
treef42440d3dad3440676d7158c41d234cac01a24a6 /perl_checker.src/common.ml
parentdc9773c0e1ae4730e0b426239b432dff93e226be (diff)
downloadperl_checker-19ec25715ed9df4a57e553b255c736bcc9cd40ac.tar
perl_checker-19ec25715ed9df4a57e553b255c736bcc9cd40ac.tar.gz
perl_checker-19ec25715ed9df4a57e553b255c736bcc9cd40ac.tar.bz2
perl_checker-19ec25715ed9df4a57e553b255c736bcc9cd40ac.tar.xz
perl_checker-19ec25715ed9df4a57e553b255c736bcc9cd40ac.zip
perfect warning for suggesting qq(...) instead of "..."
Diffstat (limited to 'perl_checker.src/common.ml')
-rw-r--r--perl_checker.src/common.ml7
1 files changed, 7 insertions, 0 deletions
diff --git a/perl_checker.src/common.ml b/perl_checker.src/common.ml
index e30dc20..554a65c 100644
--- a/perl_checker.src/common.ml
+++ b/perl_checker.src/common.ml
@@ -756,6 +756,13 @@ let count_chars_in_string s c =
Not_found -> 0
in rec_count_chars_in_string 0
+let rec string_fold_left f val_ s =
+ let val_ = ref val_ in
+ for i = 0 to String.length s - 1 do
+ val_ := f !val_ s.[i]
+ done ;
+ !val_
+
let rec string_forall_with f i s =
try
f s.[i] && string_forall_with f (i+1) s