diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-10-14 04:58:40 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-10-14 04:58:40 +0000 |
commit | 239f07fc8c33f6ebfcf5729b97f9db8b8b55e348 (patch) | |
tree | 5d5633f3622b6111c481069daab8a3106aabb1be /perl_checker.src/common.ml | |
parent | c3d34cd45e183015689139ec167275ed0e8e195a (diff) | |
download | perl-MDK-Common-239f07fc8c33f6ebfcf5729b97f9db8b8b55e348.tar perl-MDK-Common-239f07fc8c33f6ebfcf5729b97f9db8b8b55e348.tar.gz perl-MDK-Common-239f07fc8c33f6ebfcf5729b97f9db8b8b55e348.tar.bz2 perl-MDK-Common-239f07fc8c33f6ebfcf5729b97f9db8b8b55e348.tar.xz perl-MDK-Common-239f07fc8c33f6ebfcf5729b97f9db8b8b55e348.zip |
- add char_quote (to help emacs caml mode)
- change prototype of str_begins_with
Diffstat (limited to 'perl_checker.src/common.ml')
-rw-r--r-- | perl_checker.src/common.ml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/perl_checker.src/common.ml b/perl_checker.src/common.ml index c7fe403..8a0d27e 100644 --- a/perl_checker.src/common.ml +++ b/perl_checker.src/common.ml @@ -663,7 +663,7 @@ let rec graph_sort_by eq l = let int_sort l = sort (fun a b -> a - b) l -let str_begins_with s prefix = +let str_begins_with prefix s = String.sub s 0 (min (String.length s) (String.length prefix)) = prefix let rec strstr s subs = @@ -838,12 +838,12 @@ let to_CamelCase s_ = Some (s' ^ String.sub s offset (String.length s - offset)) let concat_symlink file link = - if str_begins_with link "..//" then (* ..//foo => /foo *) + if str_begins_with "..//" link then (* ..//foo => /foo *) skip_n_char 3 link else let file = if str_ends_with file "/" then chop file else file in (* s|/$|| *) let rec reduce file link = - if str_begins_with link "../" then + if str_begins_with "../" link then let file = String.sub file 0 (String.rindex file '/') in (* s|/[^/]+$|| *) reduce file (skip_n_char 3 link) else @@ -995,3 +995,6 @@ let stringSet_to_list = StringSet.elements let stringSet_add set e = StringSet.add e set let stringSet_difference = StringSet.diff let list_to_StringSet l = fold_left stringSet_add StringSet.empty l + +(* this character messes emacs caml mode *) +let char_quote = '"' |