From 9104fcd3fadb64ceb0ece125e68738a652050200 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 2 Aug 2004 04:48:58 +0000 Subject: - workaround bug in ocaml on ultrasparc (can't catch exception "Fatal error: out-of-bound access in array or string" in native code) - add begins_with in MDK::Common::String --- perl_checker.src/common.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'perl_checker.src') diff --git a/perl_checker.src/common.ml b/perl_checker.src/common.ml index 7d03ffb..c7fe403 100644 --- a/perl_checker.src/common.ml +++ b/perl_checker.src/common.ml @@ -770,11 +770,17 @@ let rec string_fold_left f val_ s = done ; !val_ +(* let rec string_forall_with f i s = try f s.[i] && string_forall_with f (i+1) s with Invalid_argument _ -> true - +*) +let string_forall_with f i s = + let len = String.length s in + let rec string_forall_with_ i = + i >= len || f s.[i] && string_forall_with_ (i+1) + in string_forall_with_ i let starts_with_non_lowercase s = s <> "" && s.[0] <> '_' && not (is_lowercase s.[0]) -- cgit v1.2.1