Skip to content

Commit

Permalink
add support for unicode 15.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
smasher164 committed Dec 28, 2023
1 parent 560c18f commit b6b9d72
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@
!go.sum
!*.md
!*.go
!*.py
!*.py
!*.lock
!*.nix
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
description = "A flake that sets up the devShell";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
let supportedSystems = [ "aarch64-linux" "i686-linux" "x86_64-linux" ];
in flake-utils.lib.eachSystem supportedSystems (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ ];
};
pp = ps: with ps; [ regex ];
in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [ go (python312.withPackages pp) ];
};
});
}
3 changes: 2 additions & 1 deletion testdata/gendata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# This script generates testdata for particular version of unicode.
# Used Python 3.8.7 && regex==2020.2.20 to generate cases for unicode 12.1.0.
# Used Python 3.9.1 && regex>2020.2.20 to generate cases for unicode 13.0.0.
# Used Python 3.12.1 && regex==2023.8.8 to generate cases for unicode 15.0.0.

import unicodedata
import regex
Expand All @@ -10,7 +11,7 @@
def gendata(category):
f = gzip.open(f'{category}{unicodedata.unidata_version}.txt.gz', 'wb')
for r in range(sys.maxunicode+1):
matched = bool(regex.match(f'\p{{{category}}}', chr(r)))
matched = bool(regex.match(f'\\p{{{category}}}', chr(r)))
if matched:
f.write(b'T')
else:
Expand Down
Binary file added testdata/xid_continue15.0.0.txt.gz
Binary file not shown.
Binary file added testdata/xid_start15.0.0.txt.gz
Binary file not shown.
1 change: 1 addition & 0 deletions unicodeTestVersion_114.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build go1.14 && !go1.16
// +build go1.14,!go1.16

package xid
Expand Down
3 changes: 2 additions & 1 deletion unicodeTestVersion_116.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// +build go1.16
//go:build go1.16 && !go1.21
// +build go1.16,!go1.21

package xid

Expand Down
6 changes: 6 additions & 0 deletions unicodeTestVersion_121.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//go:build go1.21
// +build go1.21

package xid

const unicodeTestVersion = "15.0.0"

0 comments on commit b6b9d72

Please sign in to comment.