Skip to content

Commit d464704

Browse files
authored
Merge pull request #6 from ocaml-community/unicode-16
Update to Unicode 17
2 parents 0e87169 + c22f472 commit d464704

File tree

7 files changed

+317
-272
lines changed

7 files changed

+317
-272
lines changed

CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## unreleased
22

3-
* Moved to Dune 3.17. (Antonin Décimo)
3+
* Moved to Dune 3.0. (Antonin Décimo)
4+
* Update to Unicode 16. (Antonin Décimo)
45

56
## v0.2.3 (2022-09-02)
67

notty-community.opam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ depends: [
2121
"ocaml" {>= "4.08.0"}
2222
"cppo" {build & >= "1.1.0"}
2323
"uutf" {>= "1.0.0"}
24+
"uucp" {with-dev-setup}
2425
"odoc" {with-doc}
2526
]
2627
depopts: ["lwt"]

src/no-uucp/dune

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(rule
2+
(targets notty_uucp_data.ml notty_uucp_data.mli)
3+
(enabled_if (= %{profile} "regenerate"))
4+
(action
5+
(run ../../support/gen_unicode_props.exe))
6+
(mode promote))

src/no-uucp/notty_uucp_data.ml

Lines changed: 299 additions & 262 deletions
Large diffs are not rendered by default.

src/no-uucp/notty_uucp_data.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
(* Do not edit.
22
*
33
* This module contains select unicode properties extracted from Uucp,
4-
* using `./support/gen_unicode_props.ml`.
4+
* using `../../support/gen_unicode_props.exe`.
55
*
6-
* Unicode version 13.0.0.
6+
* Unicode version 17.0.0.
77
*)
88

99
(* Uucp.Break.tty_width_hint *)

support/dune

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(executable
2+
(name gen_unicode_props)
3+
(enabled_if (= %{profile} "regenerate"))
4+
(libraries uucp))

support/gen_unicode_props.ml

100755100644
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
#!/usr/bin/env ocaml
21
(* Copyright (c) 2020 David Kaloper Meršinjak. All rights reserved.
32
See LICENSE.md. *)
43

5-
#use "topfind"
6-
#require "uucp"
7-
84
let filter p seq i = seq (fun x -> if p x then i x)
95
let map f seq i = seq (fun x -> i (f x))
106
let uchars it =
@@ -24,7 +20,7 @@ let intervals_kv seq i =
2420
seq f;
2521
match !s with Some e -> i e | _ -> ()
2622

27-
let intervals_p seq =
23+
let[@warning "-32"] intervals_p seq =
2824
map (fun x -> x, ()) seq |> intervals_kv |> map (fun (a, b, _) -> a, b)
2925

3026
(* Condenses code points into continuous range. *)
@@ -132,15 +128,15 @@ let extract (ppmli, ppml as ppfs) =
132128
133129
()
134130
135-
let file = "src/no-uucp/notty_uucp_data"
131+
let file = "notty_uucp_data"
136132
137133
let with_new name f =
138134
let o = open_out_gen [Open_trunc; Open_creat; Open_wronly] 0o664 name in
139135
let ppf = Format.formatter_of_out_channel o in
140136
f ppf; Format.pp_print_flush ppf (); close_out o
141137
142138
let () =
143-
Format.printf "Dumping Unicode v%s data to %s.@." Uucp.unicode_version file;
139+
Format.printf "Dumping Unicode v%s data to %s.ml and %s.mli.@." Uucp.unicode_version file file;
144140
with_new (file ^ ".mli") @@ fun ppmli ->
145141
with_new (file ^ ".ml") @@ fun ppml ->
146142
extract (ppmli, ppml)

0 commit comments

Comments
 (0)