From 5de07ee4a9b1694219f221761755ca170cdf257f Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 10 Dec 2002 01:50:05 +0000 Subject: perl_checker: new --generate-pot feature --- perl_checker.src/common.ml | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'perl_checker.src/common.ml') diff --git a/perl_checker.src/common.ml b/perl_checker.src/common.ml index a938ffb..f84e027 100644 --- a/perl_checker.src/common.ml +++ b/perl_checker.src/common.ml @@ -692,6 +692,15 @@ let rec explode_string = function | "" -> [] | s -> (String.get s 0) :: explode_string (String.sub s 1 (String.length s - 1)) +let count_matching_char s c = + let rec count_matching_char_ nb i = + try + let i' = String.index_from s i c in + count_matching_char_ (nb+1) (i'+1) + with Not_found -> nb + in + count_matching_char_ 0 0 + let is_uppercase c = Char.lowercase c <> c let is_lowercase c = Char.uppercase c <> c -- cgit v1.2.1