Skip to content
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 12.0 #556

Merged
merged 2 commits into from Mar 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion jflex/changelog.md
@@ -1,5 +1,5 @@
## [JFlex 1.8.0](https://github.com/jflex-de/jflex/milestone/11)
- Unicode 10.0 and 11.0 are supported (#540, #555)
- Unicode 10.0, 11.0, and 12.0 are supported (#540, #555, #556)
- Unicode Emoji properties are supported for Unicode versions 8.0+ (#546)

## [JFlex 1.7.0](https://github.com/jflex-de/jflex/milestone/10) (September 21, 2018)
Expand Down
14 changes: 12 additions & 2 deletions jflex/src/main/java/jflex/core/unicode/UnicodeProperties.java
Expand Up @@ -25,8 +25,8 @@
public class UnicodeProperties {

public static final String UNICODE_VERSIONS =
"1.1, 1.1.5, 2, 2.0, 2.0.14, 2.1, 2.1.9, 3, 3.0, 3.0.1, 3.1, 3.1.0, 3.2, 3.2.0, 4, 4.0, 4.0.1, 4.1, 4.1.0, 5, 5.0, 5.0.0, 5.1, 5.1.0, 5.2, 5.2.0, 6, 6.0, 6.0.0, 6.1, 6.1.0, 6.2, 6.2.0, 6.3, 6.3.0, 7, 7.0, 7.0.0, 8, 8.0, 8.0.0, 9, 9.0, 9.0.0, 10, 10.0, 10.0.0, 11, 11.0, 11.0.0";
private static final String DEFAULT_UNICODE_VERSION = "11.0";
"1.1, 1.1.5, 2, 2.0, 2.0.14, 2.1, 2.1.9, 3, 3.0, 3.0.1, 3.1, 3.1.0, 3.2, 3.2.0, 4, 4.0, 4.0.1, 4.1, 4.1.0, 5, 5.0, 5.0.0, 5.1, 5.1.0, 5.2, 5.2.0, 6, 6.0, 6.0.0, 6.1, 6.1.0, 6.2, 6.2.0, 6.3, 6.3.0, 7, 7.0, 7.0.0, 8, 8.0, 8.0.0, 9, 9.0, 9.0.0, 10, 10.0, 10.0.0, 11, 11.0, 11.0.0, 12, 12.0, 12.0.0";
private static final String DEFAULT_UNICODE_VERSION = "12.0";
private static final Pattern WORD_SEP_PATTERN = Pattern.compile("[-_\\s()]");

private int maximumCodePoint;
Expand Down Expand Up @@ -314,6 +314,16 @@ private void init(String version) throws UnsupportedUnicodeVersionException {
jflex.core.unicode.data.Unicode_11_0.maximumCodePoint,
jflex.core.unicode.data.Unicode_11_0.caselessMatchPartitions,
jflex.core.unicode.data.Unicode_11_0.caselessMatchPartitionSize);
} else if (Objects.equals(version, "12")
|| Objects.equals(version, "12.0")
|| Objects.equals(version, "12.0.0")) {
bind(
jflex.core.unicode.data.Unicode_12_0.propertyValues,
jflex.core.unicode.data.Unicode_12_0.intervals,
jflex.core.unicode.data.Unicode_12_0.propertyValueAliases,
jflex.core.unicode.data.Unicode_12_0.maximumCodePoint,
jflex.core.unicode.data.Unicode_12_0.caselessMatchPartitions,
jflex.core.unicode.data.Unicode_12_0.caselessMatchPartitionSize);
} else {
throw new UnsupportedUnicodeVersionException();
}
Expand Down
45,022 changes: 45,022 additions & 0 deletions jflex/src/main/java/jflex/core/unicode/data/Unicode_12_0.java

Large diffs are not rendered by default.

@@ -0,0 +1,16 @@
%%

%unicode 12.0
%public
%class UnicodeAge_12_0_age_10_0

%type int
%standalone

%include ../../resources/common-unicode-all-enumerated-property-defined-values-only-java

%%

<<EOF>> { printOutput(); return 1; }
\p{Age:10.0} { setCurCharPropertyValue("Age:10.0"); }
[^] { }