Added
Link Here
|
1 |
# HG changeset patch |
2 |
# User André Bargull <andre.bargull@gmail.com> |
3 |
# Date 1699346749 0 |
4 |
# Node ID 0e7eefda24250041d7f008cc77dfa79045afa791 |
5 |
# Parent 1e39572cb1c784039a9e14b8c36396c66cf58a5d |
6 |
Bug 1859752 - Part 9: Add new line break classes. r=platform-i18n-reviewers,dminor |
7 |
|
8 |
Use `CLASS_CHARACTER` because that matches the previous character class for most |
9 |
characters which are now part of the new character classes. |
10 |
|
11 |
Depends on D192733 |
12 |
|
13 |
Differential Revision: https://phabricator.services.mozilla.com/D192734 |
14 |
|
15 |
diff --git intl/lwbrk/LineBreaker.cpp intl/lwbrk/LineBreaker.cpp |
16 |
--- intl/lwbrk/LineBreaker.cpp |
17 |
+++ intl/lwbrk/LineBreaker.cpp |
18 |
@@ -443,17 +443,23 @@ static int8_t GetClass(uint32_t u, LineB |
19 |
/* JT = 34, [JT] */ CLASS_CHARACTER, |
20 |
/* JV = 35, [JV] */ CLASS_CHARACTER, |
21 |
/* CLOSE_PARENTHESIS = 36, [CP] */ CLASS_CLOSE_LIKE_CHARACTER, |
22 |
/* CONDITIONAL_JAPANESE_STARTER = 37, [CJ] */ CLASS_CLOSE, |
23 |
/* HEBREW_LETTER = 38, [HL] */ CLASS_CHARACTER, |
24 |
/* REGIONAL_INDICATOR = 39, [RI] */ CLASS_CHARACTER, |
25 |
/* E_BASE = 40, [EB] */ CLASS_BREAKABLE, |
26 |
/* E_MODIFIER = 41, [EM] */ CLASS_CHARACTER, |
27 |
- /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER}; |
28 |
+ /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER, |
29 |
+ /* AKSARA = 43, [AK] */ CLASS_CHARACTER, |
30 |
+ /* AKSARA_PREBASE = 44, [AP] */ CLASS_CHARACTER, |
31 |
+ /* AKSARA_START = 45, [AS] */ CLASS_CHARACTER, |
32 |
+ /* VIRAMA_FINAL = 46, [VF] */ CLASS_CHARACTER, |
33 |
+ /* VIRAMA = 47, [VI] */ CLASS_CHARACTER, |
34 |
+ }; |
35 |
|
36 |
static_assert(U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass), |
37 |
"Gecko vs ICU LineBreak class mismatch"); |
38 |
|
39 |
auto cls = GetLineBreakClass(u); |
40 |
MOZ_ASSERT(cls < mozilla::ArrayLength(sUnicodeLineBreakToClass)); |
41 |
|
42 |
// Overrides based on rules for the different line-break values given in |