Skip to content

Commit 6632aaf

Browse files
committed
spec(core): update per code review 🙀
- keep 'deadkey' out of the ldml code - other renames For: #9119
1 parent d53ae69 commit 6632aaf

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

common/web/types/src/ldml-keyboard/pattern-parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class MarkerParser {
5050
/**
5151
* Marker sentinel as a string - U+FFFF
5252
*/
53-
public static readonly SENTINEL = String.fromCodePoint(constants.marker_sentinel);
53+
public static readonly SENTINEL = String.fromCodePoint(constants.uc_sentinel);
5454
/**
5555
* Marker code as a string - U+0008
5656
*/

common/web/types/test/ldml-keyboard/test-pattern-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ describe('Test of Pattern Parsers', () => {
105105
);
106106
});
107107
it('should match some marker constants', () => {
108-
assert.equal(constants.marker_sentinel, KMXFile.UC_SENTINEL);
109-
assert.equal(constants.marker_code_deadkey, KMXFile.CODE_DEADKEY);
108+
assert.equal(constants.uc_sentinel, KMXFile.UC_SENTINEL);
109+
assert.equal(constants.marker_code, KMXFile.CODE_DEADKEY);
110110
});
111111
});
112112
describe('should test VariableParser', () => {

core/include/ldml/keyboardprocessor_ldml.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,10 @@
9494
#define LDML_LENGTH_VKEY 0xC
9595
#define LDML_LENGTH_VKEY_ITEM 0x8
9696
#define LDML_MARKER_ANY_INDEX 0xFFFE
97-
#define LDML_MARKER_CODE_DEADKEY 0x8
97+
#define LDML_MARKER_CODE 0x8
9898
#define LDML_MARKER_MAX_COUNT 0xFFFC
9999
#define LDML_MARKER_MAX_INDEX 0xFFFD
100100
#define LDML_MARKER_MIN_INDEX 0x1
101-
#define LDML_MARKER_SENTINEL 0xFFFF
102101
#define LDML_META_SETTINGS_FALLBACK_OMIT 0x1
103102
#define LDML_META_SETTINGS_TRANSFORMFAILURE_OMIT 0x2
104103
#define LDML_META_SETTINGS_TRANSFORMPARTIAL_HIDE 0x4
@@ -135,6 +134,7 @@
135134
#define LDML_TRAN_FLAGS_ERROR 0x1
136135
#define LDML_TRAN_GROUP_TYPE_REORDER 0x1
137136
#define LDML_TRAN_GROUP_TYPE_TRANSFORM 0x0
137+
#define LDML_UC_SENTINEL 0xFFFF
138138
#define LDML_VARS_ENTRY_TYPE_SET 0x1
139139
#define LDML_VARS_ENTRY_TYPE_STRING 0x0
140140
#define LDML_VARS_ENTRY_TYPE_UNICODESET 0x2

core/include/ldml/keyboardprocessor_ldml.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,9 @@ class Constants {
616616

617617
// ---- marker stuff ----
618618
/** == kmx_file.UC_SENTINEL, always followed by `marker_code`, marker index 0x0001-0xfffe */
619-
readonly marker_sentinel = 0xFFFF;
619+
readonly uc_sentinel = 0xFFFF;
620620
/** == kmx_file.CODE_DEADKEY */
621-
readonly marker_code = 0x0008;
621+
readonly marker_code = 0x0008;
622622
/** minimum usable marker index */
623623
readonly marker_min_index = 0x0001;
624624
/** index value referring to the 'any' marker match */

core/src/kmx/kmx_plus.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static_assert(sizeof(struct COMP_KMXPLUS_TRAN_TRANSFORM) == LDML_LENGTH_TRAN_TRA
311311
static_assert(sizeof(struct COMP_KMXPLUS_TRAN_REORDER) == LDML_LENGTH_TRAN_REORDER, "mismatched size of tran reorder");
312312

313313
// assert some parallel constants
314-
static_assert(LDML_MARKER_SENTINEL == UC_SENTINEL, "mismatch: LDML_MARKER_SENTINEL");
314+
static_assert(LDML_UC_SENTINEL == UC_SENTINEL, "mismatch: LDML_UC_SENTINEL");
315315
static_assert(LDML_MARKER_CODE == CODE_DEADKEY, "mismatch: LDML_MARKER_CODE");
316316
static_assert(LDML_MARKER_ANY_INDEX < UC_SENTINEL, "expected LDML_MARKER_ANY_INDEX < UC_SENTINEL");
317317

developer/src/kmc-ldml/test/test-vars.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ describe('vars', function () {
191191
describe('should match some marker constants', () => {
192192
// neither of these live here, but, common/web/types does not import ldml-keyboard-constants otherwise.
193193

194-
assert.equal(constants.marker_sentinel, KMX.KMXFile.UC_SENTINEL);
195-
assert.equal(constants.marker_code_deadkey, KMX.KMXFile.CODE_DEADKEY);
194+
assert.equal(constants.uc_sentinel, KMX.KMXFile.UC_SENTINEL);
195+
assert.equal(constants.marker_code, KMX.KMXFile.CODE_DEADKEY);
196196
});
197197
describe('markers', function () {
198198
this.slow(500); // 0.5 sec -- json schema validation takes a while

0 commit comments

Comments
 (0)