summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/common.ml
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-08-02 04:48:58 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-08-02 04:48:58 +0000
commit2b9fcc72ed97ec345a0769817e13379a98a02862 (patch)
tree96f94ae289330dee7e4be2c17bd4cd3ef9b6ffbd /perl_checker.src/common.ml
parent4eb86f480428513e47aeeb97d671bbffba6daa14 (diff)
downloadperl-MDK-Common-2b9fcc72ed97ec345a0769817e13379a98a02862.tar
perl-MDK-Common-2b9fcc72ed97ec345a0769817e13379a98a02862.tar.gz
perl-MDK-Common-2b9fcc72ed97ec345a0769817e13379a98a02862.tar.bz2
perl-MDK-Common-2b9fcc72ed97ec345a0769817e13379a98a02862.tar.xz
perl-MDK-Common-2b9fcc72ed97ec345a0769817e13379a98a02862.zip
- 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
Diffstat (limited to 'perl_checker.src/common.ml')
-rw-r--r--perl_checker.src/common.ml8
1 files changed, 7 insertions, 1 deletions
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])