Skip to content

Commit 8ec8bce

Browse files
committed
Remove calls to deprecated String.capitalize, depends on Astring
1 parent 9700632 commit 8ec8bce

7 files changed

Lines changed: 11 additions & 11 deletions

File tree

.travis-ci.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Edit this for your own project dependencies
2-
OPAM_DEPENDS="ocamlfind pprint ocp-build"
2+
OPAM_DEPENDS="ocamlfind pprint ocp-build astring"
33

44
case "$OCAML_VERSION,$OPAM_VERSION" in
5-
4.00.1,1.2.0) ppa=avsm/ocaml40+opam12 ;;
65
4.01.0,1.2.0) ppa=avsm/ocaml41+opam12 ;;
76
4.02.1,1.2.0) ppa=avsm/ocaml42+opam12 ;;
7+
4.04.2,1.2.0) ppa=avsm/ocaml44+opam12 ;;
88
*) echo Unknown $OCAML_VERSION,$OPAM_VERSION; exit 1 ;;
99
esac
1010

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ LIBDIR ?= $(shell ocamlfind printconf destdir)
22
BINDIR ?= $(LIBDIR)/../bin
33
DOCDIR ?= $(LIBDIR)/../doc
44

5-
PACKAGES=unix,str,pprint,dynlink
5+
PACKAGES=unix,str,pprint,astring,dynlink
66
.PHONY: all clean \
77
install uninstall \
88
doc install-doc uninstall-doc

build.ocp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ begin library "ocplib-ocamlres"
1111
"src/oCamlResRegistry.ml"
1212
"src/oCamlResScanners.ml"
1313
]
14-
requires = [ "str" "unix" "dynlink" "pprint" ]
14+
requires = [ "str" "unix" "dynlink" "pprint" "astring" ]
1515
asmcomp = [ "-g" ]
1616
end
1717

opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ maintainer: "benjamin@ocamlpro.com"
55
authors: "benjamin@ocamlpro.com"
66
homepage: "https://github.com/OCamlPro/ocp-ocamlres"
77
bug-reports: "https://github.com/OCamlPro/ocp-ocamlres/issues"
8-
depends: ["ocamlfind" "base-unix" "pprint"]
8+
depends: ["ocamlfind" "base-unix" "pprint" "astring"]
99
available: ocaml-version >= "4.01.0"
1010
build: [
1111
[make "all"]

src/META

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ archive(byte) = "ocplib-ocamlres.cma"
55
archive(byte, plugin) = "ocplib-ocamlres.cma"
66
archive(native) = "ocplib-ocamlres.cmxa"
77
archive(native, plugin) = "ocplib-ocamlres.cmxs"
8-
requires = "pprint,str,ocplib-ocamlres.runtime"
8+
requires = "pprint,str,ocplib-ocamlres.runtime,astring"
99
exists_if = "ocplib-ocamlres.cma"
1010

1111
package "runtime" (

src/oCamlResFormats.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module OCaml (SF : SubFormat) = struct
5757
match name.[0] with
5858
| '0' .. '9' -> "M_" ^ res
5959
| '_' -> "M" ^ res
60-
| 'a'..'z' -> String.capitalize res
60+
| 'a'..'z' -> Astring.String.Ascii.capitalize res
6161
| _ -> res
6262

6363
let output params root =
@@ -114,18 +114,18 @@ module Res (SF : SubFormat) = struct
114114
let cases =
115115
separate_map hardline
116116
(fun (c, t) ->
117-
!^"| " ^^ !^ (String.capitalize c) ^^ !^" of " ^^ !^t) l
117+
!^"| " ^^ !^ (Astring.String.Ascii.capitalize c) ^^ !^" of " ^^ !^t) l
118118
in
119119
hd := [ group (!^"type content =" ^^ nest 2 (hardline ^^ cases)) ]
120120
end ; true
121121
in
122122
let res_cstr ext =
123123
if not box then !^"" else
124124
!^((if params.use_variants_for_leaves then "`" else "")
125-
^ String.capitalize ext ^ " ") in
125+
^ Astring.String.Ascii.capitalize ext ^ " ") in
126126
let node_cstr ext =
127127
!^((if params.use_variants_for_nodes then "`" else "")
128-
^ String.capitalize ext ^ " ") in
128+
^ Astring.String.Ascii.capitalize ext ^ " ") in
129129
let rec output dirs node =
130130
match node with
131131
| Error msg ->

src/oCamlResMain.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ let prefixed_file = ref false
9393

9494
(** Prints the version number *)
9595
let version () =
96-
Format.printf "0.1\n" ;
96+
Format.printf "0.4\n" ;
9797
exit 0
9898

9999
(** Parse the preload arguments, scan and filter the files, select the

0 commit comments

Comments
 (0)