Skip to content

Commit 7b5b915

Browse files
committed
Renames
1 parent c392537 commit 7b5b915

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pipeline {
110110
}
111111
environment {
112112
CXX = 'clang++-6.0'
113-
MACOS_SWITCH = 'stanc3-4.14'
113+
MACOS_SWITCH = 'stanc3-4.14-unicode'
114114
PARALLEL = 4
115115
GIT_AUTHOR_NAME = 'Stan Jenkins'
116116
GIT_AUTHOR_EMAIL = '[email protected]'

scripts/install_build_deps.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ eval $(opam env)
88
opam pin -y core v0.16.0 --no-action
99

1010
opam install -y dune core.v0.16.0 menhir.20230608 ppx_deriving.5.2.1 fmt.0.9.0 yojson.2.1.0\
11-
cmdliner.1.3.0 uucp.15.1.0 uunf.15.1.0
11+
cmdliner.1.3.0 uucp.16.0.0 uunf.16.0.0
1212

1313
eval $(opam env)

scripts/install_build_deps_windows.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ opam install -y "ocaml-windows64=4.14.1"
1414

1515
# Install dependencies
1616
opam install -y core.v0.16.1 core-windows.v0.16.1 menhir.20230608 menhir-windows.20230608 ppx_deriving.5.2.1 ppx_deriving-windows.5.2.1\
17-
fmt.0.9.0 fmt-windows.0.9.0 yojson.2.1.0 yojson-windows.2.1.0 cmdliner.1.3.0 cmdliner-windows.1.3.0 uucp.15.1.0 uucp-windows.15.1.0\
18-
uunf.15.1.0 uunf-windows.15.1.0
17+
fmt.0.9.0 fmt-windows.0.9.0 yojson.2.1.0 yojson-windows.2.1.0 cmdliner.1.3.0 cmdliner-windows.1.3.0 uucp.16.0.0 uucp-windows.16.0.0\
18+
uunf.16.0.0 uunf-windows.16.0.0
1919

2020
eval $(opam env)

src/common/Unicode.ml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let is_ascii s =
1313

1414
let normalize = Uunf_string.normalize_utf_8 `NFKC
1515

16-
let fold_uchars f acc str =
16+
let foldi_uchars ~f acc str =
1717
let len = String.length str in
1818
let rec loop pos acc =
1919
if pos == len then acc
@@ -25,19 +25,22 @@ let fold_uchars f acc str =
2525
loop (pos + char_length) acc in
2626
loop 0 acc
2727

28-
let iter_uchars s f =
28+
let iteri_uchars ~f str =
2929
let f' buf pos c =
3030
f pos c;
3131
Buffer.add_utf_8_uchar buf c;
3232
buf in
3333
let s_after =
34-
Buffer.contents @@ fold_uchars f' (Buffer.create (String.length s)) s in
34+
Buffer.contents
35+
@@ foldi_uchars ~f:f' (Buffer.create (String.length str)) str in
3536
(* another sanity check *)
36-
if not (String.equal s s_after) then
37+
if not (String.equal str s_after) then
3738
Core.(
3839
ICE.internal_compiler_error
3940
[%message
40-
"Failed to round-trip unicode string!" (s : string) (s_after : string)])
41+
"Failed to round-trip unicode string!"
42+
(str : string)
43+
(s_after : string)])
4144

4245
(* WIP:
4346
@@ -60,7 +63,7 @@ let confusable x y =
6063
(* TODO!! replace with prototype - need data? *)
6164
Buffer.add_utf_8_uchar acc c;
6265
acc in
63-
let buf = fold_uchars f (Buffer.create (String.length x)) x in
66+
let buf = foldi_uchars ~f (Buffer.create (String.length x)) x in
6467
let x = Buffer.contents buf in
6568
let x = Uunf_string.normalize_utf_8 `NFD x in
6669
x in
@@ -98,7 +101,7 @@ let restriction_level x =
98101
let scripts =
99102
Uucp.Script.script_extensions c |> ScriptSet.of_list |> extended in
100103
scripts :: acc in
101-
let soss = fold_uchars f [] x in
104+
let soss = foldi_uchars ~f [] x in
102105
let resolved = List.fold_right ScriptSet.inter soss all in
103106
if not @@ ScriptSet.is_empty resolved then `Single
104107
else `Unrestricted (* TODO implement levels 3-5 *)

src/frontend/Identifiers.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let validate_utf8_id ~loc id =
3838
error ~loc
3939
(Fmt.str "Invalid character in identifier at offset %d: '%a'" pos
4040
pp_uchar uchar) in
41-
iter_uchars id f;
41+
iteri_uchars ~f id;
4242
id
4343

4444
let validate loc id =

src/stan_math_backend/Cpp.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ module Printing = struct
399399
let uchar_int = Uchar.to_scalar c in
400400
if uchar_int < 128 then Fmt.char ppf (Char.of_int_exn uchar_int)
401401
else Fmt.pf ppf "\\u%04X" (Uchar.to_scalar c) in
402-
Common.Unicode.iter_uchars s f
402+
Common.Unicode.iteri_uchars ~f s
403403

404404
let rec pp_type_ ppf t =
405405
match t with

0 commit comments

Comments
 (0)