-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for unicode 16.0.0. #157
base: master
Are you sure you want to change the base?
Changes from 7 commits
8a37c6b
502d08f
18456fb
bcab433
1890724
7cd4825
78af0c6
d93aeb6
975e541
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
(* This test that unicode_old.ml is a strict sub-set of | ||
* new unicode.ml. *) | ||
|
||
let test_versions = ("14.0.0", "15.0.0") | ||
let test_versions = ("15.0.0", "16.0.0") | ||
let regressions = [] | ||
let interval s e = Array.to_list (Array.init (e - s) (fun pos -> s + pos)) | ||
|
||
|
@@ -13,7 +13,7 @@ let test_exception name x = | |
List.iter (fun (s, e) -> if s <= x && x <= e then raise Found) l | ||
with Not_found -> () | ||
|
||
let compare name (old_l : (int * int) list) (new_l : Sedlex_ppx.Sedlex_cset.t) = | ||
let compare name (old_l : (int * int) list) (new_l : Sedlex_utils.Cset.t) = | ||
let new_l = (new_l :> (int * int) list) in | ||
let code_points = | ||
List.fold_left (fun res (s, e) -> res @ interval s e) [] old_l | ||
|
@@ -32,6 +32,7 @@ let compare name (old_l : (int * int) list) (new_l : Sedlex_ppx.Sedlex_cset.t) = | |
code_points | ||
|
||
let test new_l (name, old_l) = | ||
let old_l = Sedlex_utils.Cset.to_list old_l in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be better to manipulate cset directly. See #159 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It still fails with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. type t = private (int * int) list
let to_list l = l |
||
(* Cn is for unassigned code points, which are allowed to be | ||
* used in future version. *) | ||
if name <> "cn" then compare name old_l (List.assoc name new_l) | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
https://www.unicode.org/Public/15.0.0 | ||
https://www.unicode.org/Public/16.0.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ let print_elements ch hashtbl cats = | |
(fun (b, e) -> Printf.sprintf "0x%x, 0x%x" b e) | ||
(Cset.union_list (Hashtbl.find_all hashtbl c) :> (int * int) list) | ||
in | ||
Printf.fprintf ch " let %s = Sedlex_cset.of_list\n [" c; | ||
Printf.fprintf ch " let %s = Sedlex_utils.Cset.of_list\n [" c; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand why we need this diff There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ideally, If you use Happy to find a better solution but, also, I don't think that it matters. |
||
List.iteri | ||
(fun i x -> | ||
if i > 0 then | ||
|
@@ -91,7 +91,8 @@ let files = | |
let interval = parse_interval interval in | ||
let prop = parse_prop prop in | ||
Hashtbl.add labels prop interval | ||
| _ -> assert false ); | ||
(* TODO: support non-binary properties? *) | ||
| _ -> () ); | ||
toots marked this conversation as resolved.
Show resolved
Hide resolved
|
||
( "DerivedGeneralCategory.txt", | ||
fun s -> | ||
match parse_line s with | ||
|
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sedlex_utils only contains the cset implementation that is already accessible using
Sedlex_ppx.Sedlex_cset
.