Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1642,6 +1642,42 @@ private static void parseFields(
// 21EA..21F3;;⇪..⇳;;;; 21EA-21F3 are keyboard
value = "None";
}
if (line.getParts().length == 3
&& (propInfo.property == UcdProperty.Block
|| propInfo.property == UcdProperty.Pretty_Block)) {
// The old Blocks files had First; Last; Block.
IntRange range = new IntRange();
range.start = Utility.codePointFromHex(line.getParts()[0]);
range.end = Utility.codePointFromHex(line.getParts()[1]);
// Unicode 2 puts FEFF both in Arabic Presentation Forms-B and in Specials.
// We are not going to make Block multivalued for that, so we let the second
// assignment win.
// This fits with assignments in Unicode 2.1.4..3.1.1 where
// Arabic Presentation Forms-B ended on FEFE and Specials was a
// split Block of FEFF & FFF0..FFFD.
// Since Unicode 3.2, blocks were contiguous xxx0..yyyF:
// https://www.unicode.org/reports/tr28/tr28-3.html#database
// The normative blocks defined in Blocks.txt have been adjusted slightly,
// in accordance with Unicode Technical Committee decisions.
// - Every block starts and ends on a column boundary.
// That is, the last digit of the first code point in the block is always 0,
// and the last digit of the final code point in the block is always F.
// - Every block is contiguous. [...]
propInfo.put(
data,
line.getMissingSet(),
range,
line.getParts()[2],
indexUnicodeProperties.ucdVersion.getMajor() == 2
? new PropertyUtilities.Overrider()
: null,
false,
nextProperties == null
? null
: nextProperties.getProperty(propInfo.property),
indexUnicodeProperties.getUcdVersion());
continue;
}
if (propInfo.getFieldMapping(indexUnicodeProperties.ucdVersion).keyField == 0) {
propInfo.put(
data,
Expand Down Expand Up @@ -1725,36 +1761,7 @@ private static void parseSimpleFieldFile(
}
}
Merge<String> merger = null;
if (line.getParts().length == 3 && propInfo.property == UcdProperty.Block) {
// The old Blocks files had First; Last; Block.
IntRange range = new IntRange();
range.start = Utility.codePointFromHex(line.getParts()[0]);
range.end = Utility.codePointFromHex(line.getParts()[1]);
// Unicode 2 puts FEFF both in Arabic Presentation Forms-B and in Specials.
// We are not going to make Block multivalued for that, so we let the second
// assignment win.
// This fits with assignments in Unicode 2.1.4..3.1.1 where
// Arabic Presentation Forms-B ended on FEFE and Specials was a
// split Block of FEFF & FFF0..FFFD.
// Since Unicode 3.2, blocks were contiguous xxx0..yyyF:
// https://www.unicode.org/reports/tr28/tr28-3.html#database
// The normative blocks defined in Blocks.txt have been adjusted slightly,
// in accordance with Unicode Technical Committee decisions.
// - Every block starts and ends on a column boundary.
// That is, the last digit of the first code point in the block is always 0,
// and the last digit of the final code point in the block is always F.
// - Every block is contiguous. [...]
propInfo.put(
data,
line.getMissingSet(),
range,
line.getParts()[2],
version.getMajor() == 2 ? new PropertyUtilities.Overrider() : null,
false,
nextVersion,
indexUnicodeProperties.getUcdVersion());
continue;
} else if (propInfo.property == UcdProperty.Numeric_Value) {
if (propInfo.property == UcdProperty.Numeric_Value) {
String extractedValue = line.getParts()[1];
for (int cp = line.getRange().start; cp <= line.getRange().end; ++cp) {
String unicodeDataValue =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ public enum UcdProperty {
PropertyType.Miscellaneous,
DerivedPropertyStatus.UCDNonProperty,
"Names_List_Subheader_Notice"),
Pretty_Block(PropertyType.Miscellaneous, DerivedPropertyStatus.UCDNonProperty, "Pretty_Block"),
Standardized_Variant(
PropertyType.Miscellaneous,
DerivedPropertyStatus.UCDNonProperty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2214,6 +2214,7 @@ public static Other_Joining_Type_Values forName(String name) {
}
}

// Pretty_Block
public enum RGI_Emoji_Qualification_Values implements Named {
None("None"),
Fully_Qualified("FQE"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ private static void propertywiseAlikeLine(
final var iup = IndexUnicodeProperties.make(Settings.latestVersion);
final List<String> errorMessageLines = new ArrayList<>();
for (var p : UcdProperty.values()) {
if (p.name().startsWith("Names_List_")) {
if (p.name().startsWith("Names_List_") || p == UcdProperty.Pretty_Block) {
continue;
}
final var property = iup.getProperty(p);
Expand Down Expand Up @@ -654,7 +654,7 @@ public ExpectedPropertyDifference(String actualValueAlias, String referenceValue
} while (Lookahead.oneToken(pp, source).accept(","));
}
for (var p : UcdProperty.values()) {
if (p.name().startsWith("Names_List_")) {
if (p.name().startsWith("Names_List_") || p == UcdProperty.Pretty_Block) {
continue;
}
final var property = iup.getProperty(p);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ Link_Bracket ; Link_Bracket ; NonUCDProperty
# Miscellaneous Properties
# ================================================

# The spelling of the block name in Blocks.txt, which is not exactly the
# matching one in PropertyValueAliases.txt (the latter has _ instead of both
# spaces and hyphens, and they also differ in case, e.g. Greek_And_Coptic vs.
# Greek and Coptic.).
Pretty_Block ; Pretty_Block ; UCDNonProperty

Arabic_Shaping_Schematic_Name ; Arabic_Shaping_Schematic_Name ; UCDNonProperty

CJKR ; CJK_Radical ; UCDNonProperty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ DerivedJoiningType; Joining_Type; 1
ArabicShaping; Joining_Group; 3
BidiMirroring; Bidi_Mirroring_Glyph;
Blocks ; Block
Blocks ; Pretty_Block
CompositionExclusions ; Composition_Exclusion
DerivedAge ; Age
EastAsianWidth ; East_Asian_Width
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,10 @@ In \P{U6.0:Math_Class_Ex=None}, U6.0:Math_Class = U6.0:Math_Class_Ex
\p{U6.1:Math_Class=None} ⊂ \p{U6.1:Math_Class_Ex=None}
\p{U6.0:Math_Class=None} ⊂ \p{U6.0:Math_Class_Ex=None}

# Pretty_Block is just Block, but prettier.

OnPairsOf $code_points, EqualityOf Block ⇔ EqualityOf Pretty_Block

# Basic Propertywise tests.
Ignoring Name:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public void TestUniformUnassigned() {
UcdProperty.NFKC_Simple_Casefold,
UcdProperty.Age,
UcdProperty.Block,
UcdProperty.Pretty_Block,
UcdProperty.Bidi_Class,
UcdProperty.East_Asian_Width,
UcdProperty.Grapheme_Cluster_Break,
Expand All @@ -166,8 +167,10 @@ public void TestUniformUnassigned() {
UcdProperty.Names_List_Subheader_Notice));
exceptions.putAll(
General_Category_Values.Private_Use,
Arrays.asList(UcdProperty.Age, UcdProperty.Block));
exceptions.put(General_Category_Values.Surrogate, UcdProperty.Block);
Arrays.asList(UcdProperty.Age, UcdProperty.Block, UcdProperty.Pretty_Block));
exceptions.putAll(
General_Category_Values.Surrogate,
Arrays.asList(UcdProperty.Block, UcdProperty.Pretty_Block));

List<UcdProperty> ordered = new ArrayList<>();
// ordered.add(UcdProperty.Bidi_Class);
Expand Down
Loading