Skip to content

Commit 5a809ba

Browse files
committed
[GR-64633] TRegex: update Unicode version in Java flavor.
PullRequest: graal/21251
2 parents a48ef83 + 2bdbaf8 commit 5a809ba

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

regex/src/com.oracle.truffle.regex/src/com/oracle/truffle/regex/tregex/parser/flavors/java/JavaUnicodeProperties.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
final class JavaUnicodeProperties {
5757

58-
private static final int N_UNICODE_VERSIONS = 2;
58+
private static final int N_UNICODE_VERSIONS = 3;
5959
private static final JavaUnicodeProperties[] CACHE = new JavaUnicodeProperties[N_UNICODE_VERSIONS];
6060

6161
// 0x000A, LINE FEED (LF), <LF>
@@ -253,6 +253,8 @@ private static int unicodeVersionToCacheIndex(UnicodePropertyData propertyDataVe
253253
return 0;
254254
} else if (propertyDataVersion == UnicodePropertyDataVersion.UNICODE_15_1_0) {
255255
return 1;
256+
} else if (propertyDataVersion == UnicodePropertyDataVersion.UNICODE_16_0_0) {
257+
return 2;
256258
} else {
257259
throw CompilerDirectives.shouldNotReachHere();
258260
}
@@ -262,7 +264,10 @@ private static UnicodePropertyData getUnicodePropertyData(int jdkVersion) {
262264
if (jdkVersion == 21) {
263265
return UnicodePropertyDataVersion.UNICODE_15_0_0;
264266
}
265-
return UnicodePropertyDataVersion.UNICODE_15_1_0;
267+
if (jdkVersion <= 23) {
268+
return UnicodePropertyDataVersion.UNICODE_15_1_0;
269+
}
270+
return UnicodePropertyDataVersion.UNICODE_16_0_0;
266271
}
267272

268273
private CodePointSet unionOfProperties(String... properties) {

0 commit comments

Comments
 (0)