summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/common.ml
diff options
context:
space:
mode:
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