mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-08 09:55:32 +00:00
feat(core): rearrange elem flags 🙀
- per review comments, make the elem flags clearer For: #7377
This commit is contained in:
parent
a6dcf4dfce
commit
ebcccbe0ef
4 changed files with 25 additions and 26 deletions
|
|
@ -22,14 +22,14 @@
|
|||
#define LDML_CLDR_VERSION_TECHPREVIEW "techpreview"
|
||||
#define LDML_ELEM_FLAGS_ORDER_BITSHIFT 0x10
|
||||
#define LDML_ELEM_FLAGS_ORDER_MASK 0xFF0000
|
||||
#define LDML_ELEM_FLAGS_PREBASE 0x2
|
||||
#define LDML_ELEM_FLAGS_TERTIARY_BASE 0x1
|
||||
#define LDML_ELEM_FLAGS_PREBASE 0x8
|
||||
#define LDML_ELEM_FLAGS_TERTIARY_BASE 0x4
|
||||
#define LDML_ELEM_FLAGS_TERTIARY_BITSHIFT 0x18
|
||||
#define LDML_ELEM_FLAGS_TERTIARY_MASK 0xFF000000
|
||||
#define LDML_ELEM_FLAGS_TYPE 0xC
|
||||
#define LDML_ELEM_FLAGS_TYPE 0x3
|
||||
#define LDML_ELEM_FLAGS_TYPE_CHAR 0x0
|
||||
#define LDML_ELEM_FLAGS_TYPE_STR 0x4
|
||||
#define LDML_ELEM_FLAGS_TYPE_USET 0x8
|
||||
#define LDML_ELEM_FLAGS_TYPE_STR 0x1
|
||||
#define LDML_ELEM_FLAGS_TYPE_USET 0x2
|
||||
#define LDML_FINL_FLAGS_ERROR 0x1
|
||||
#define LDML_KEYS_FLICK_FLAGS_EXTEND 0x1
|
||||
#define LDML_KEYS_KEY_FLAGS_EXTEND 0x1
|
||||
|
|
|
|||
|
|
@ -139,6 +139,19 @@ class Constants {
|
|||
*/
|
||||
readonly length_elem_item_element = 8;
|
||||
|
||||
/**
|
||||
* bitwise or value for type in elem[elemstr][element].flags.
|
||||
* If bits are 00b, then 'element' is a UTF-32LE codepoint.
|
||||
* If bits are 01b, then 'element' is a string index.
|
||||
* If bits are 10b (2), then 'element' is a uset index.
|
||||
*
|
||||
* `type = flags & elem_flags_type`
|
||||
*/
|
||||
readonly elem_flags_type = 0x00000003;
|
||||
readonly elem_flags_type_char = 0x00000000;
|
||||
readonly elem_flags_type_str = 0x00000001;
|
||||
readonly elem_flags_type_uset = 0x00000002;
|
||||
|
||||
/**
|
||||
* bitwise or value for tertiary_base in elem[elemstr][element].flags.
|
||||
* If bit is 1, then tertiary_base is true.
|
||||
|
|
@ -148,7 +161,7 @@ class Constants {
|
|||
*
|
||||
* `tertiary_base = flags & elem_flags_tertiary_base`
|
||||
*/
|
||||
readonly elem_flags_tertiary_base = 0x00000001;
|
||||
readonly elem_flags_tertiary_base = 0x00000004;
|
||||
|
||||
/**
|
||||
* bitwise or value for tertiary_base in elem[elemstr][element].flags.
|
||||
|
|
@ -159,21 +172,7 @@ class Constants {
|
|||
*
|
||||
* `prebase = flags & elem_flags_prebase`
|
||||
*/
|
||||
readonly elem_flags_prebase = 0x00000002;
|
||||
|
||||
/**
|
||||
* bitwise or value for type in elem[elemstr][element].flags.
|
||||
* If bits are 00b, then 'element' is a UTF-32LE codepoint.
|
||||
* If bits are 01b, then 'element' is a string index.
|
||||
* If bits are 10b (2), then 'element' is a uset index.
|
||||
*
|
||||
* `type = flags & elem_flags_type`
|
||||
*/
|
||||
readonly elem_flags_type = 0x0000000C;
|
||||
readonly elem_flags_type_char = 0x0 << 2;
|
||||
readonly elem_flags_type_str = 0x1 << 2;
|
||||
readonly elem_flags_type_uset = 0x2 << 2;
|
||||
|
||||
readonly elem_flags_prebase = 0x00000008;
|
||||
|
||||
/**
|
||||
* bitwise mask for order in elem[elemstr][element].flags.
|
||||
|
|
|
|||
|
|
@ -93,9 +93,9 @@ Each element string is made up of elements with the following item structure:
|
|||
|
||||
| Bit position | Meaning | Description |
|
||||
|--------------|---------------|-------------------------------------------|
|
||||
| 0 | tertiary_base | 1: tertiary_base is true |
|
||||
| 1 | prebase | 1: prebase is true |
|
||||
| 2-3 | type | `element` is 0: UTF-32LE, 1: str, 2: uset |
|
||||
| 0-1 | type | `element` is 0: UTF-32LE, 1: str, 2: uset |
|
||||
| 2 | tertiary_base | 1: tertiary_base is true |
|
||||
| 3 | prebase | 1: prebase is true |
|
||||
| 4-15 | reserved | reserved |
|
||||
| 16-23 | order | signed int: -128 to +127 |
|
||||
| 24-31 | tertiary | signed int: -128 to +127 |
|
||||
|
|
|
|||
|
|
@ -227,8 +227,8 @@ block(elemOrdrFrom)
|
|||
# from="\u{1A60}[\u1A75-\u1A79]\u{1A45}" order="10 55 10"
|
||||
60 1a 00 00 # KMX_DWORD element; '᩠' // str: output string or UTF-32LE codepoint
|
||||
00 00 0A 00 # KMX_DWORD flags; // flag and order values - cp
|
||||
00 00 00 00 # TODO-LDML: uset #0 # KMX_DWORD element; [uset] // str: output string or UTF-32LE codepoint
|
||||
08 00 37 00 # KMX_DWORD flags; // flag and order values - unicodeset
|
||||
00 00 00 00 # TODO-LDML: uset #0 # KMX_DWORD element; [uset] // str: output string or UTF-32LE codepoint
|
||||
02 00 37 00 # KMX_DWORD flags; // flag and order values - unicodeset
|
||||
45 1A 00 00 # KMX_DWORD element; 'ᩅ' // str: output string or UTF-32LE codepoint
|
||||
00 00 0A 00 # KMX_DWORD flags; // flag and order values - unicodeset
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue