Skip to content

VersionedProperty support in the JSPs #432

@eggrobin

Description

@eggrobin

The invariant test have a versioned property syntax, e.g., \p{U4.1:XID_Continue}, implemented in VersionedProperty.

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions