-
-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Description
The invariant test have a versioned property syntax, e.g., \p{U4.1:XID_Continue}, implemented in VersionedProperty.
unicodetools/unicodetools/src/main/java/org/unicode/text/UCD/TestUnicodeInvariants.java
Lines 1033 to 1072 in 70dce2c
| static class VersionedProperty { | |
| private String propertyName; | |
| private String version; | |
| private UnicodeProperty.Factory propSource; | |
| private UnicodeProperty property; | |
| private final transient PatternMatcher matcher = new UnicodeProperty.RegexMatcher(); | |
| public VersionedProperty set(String xPropertyName) { | |
| xPropertyName = xPropertyName.trim(); | |
| if (xPropertyName.contains(":")) { | |
| final String[] names = xPropertyName.split(":"); | |
| if (names.length != 2 || !names[0].startsWith("U")) { | |
| throw new IllegalArgumentException("Too many ':' fields in " + xPropertyName); | |
| } | |
| if (names[0].equalsIgnoreCase("U-1")) { | |
| version = LAST_VERSION; | |
| } else { | |
| version = names[0].substring(1); | |
| } | |
| xPropertyName = names[1]; | |
| } else { | |
| version = LATEST_VERSION; | |
| } | |
| ; | |
| propertyName = xPropertyName; | |
| propSource = getProperties(version); | |
| property = propSource.getProperty(xPropertyName); | |
| if (property == null) { | |
| propSource = getIndexedProperties(version); | |
| property = propSource.getProperty(xPropertyName); | |
| if (property == null) { | |
| throw new IllegalArgumentException( | |
| "Can't create property from name: " | |
| + propertyName | |
| + " and version: " | |
| + version); | |
| } | |
| } | |
| return this; | |
| } |
Something like that would be useful for list-unicodeset.jsp.
It sounds like there is limited support for multiple versions with the β syntax, but I cannot figure out how that one is implemented.
Metadata
Metadata
Assignees
Labels
No labels