@keymanapp/kmc-ldml 17.0.155-alpha → 17.0.156-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/build/src/compiler/compiler.d.ts +57 -55
  2. package/build/src/compiler/compiler.d.ts.map +1 -1
  3. package/build/src/compiler/compiler.js +198 -198
  4. package/build/src/compiler/compiler.js.map +1 -1
  5. package/build/src/compiler/disp.d.ts +14 -12
  6. package/build/src/compiler/disp.d.ts.map +1 -1
  7. package/build/src/compiler/disp.js +45 -43
  8. package/build/src/compiler/disp.js.map +1 -1
  9. package/build/src/compiler/empty-compiler.d.ts +39 -37
  10. package/build/src/compiler/empty-compiler.d.ts.map +1 -1
  11. package/build/src/compiler/empty-compiler.js +71 -69
  12. package/build/src/compiler/empty-compiler.js.map +1 -1
  13. package/build/src/compiler/keymanweb-compiler.d.ts +16 -16
  14. package/build/src/compiler/keymanweb-compiler.d.ts.map +1 -1
  15. package/build/src/compiler/keymanweb-compiler.js +97 -96
  16. package/build/src/compiler/keymanweb-compiler.js.map +1 -1
  17. package/build/src/compiler/keys.d.ts +30 -28
  18. package/build/src/compiler/keys.d.ts.map +1 -1
  19. package/build/src/compiler/keys.js +240 -238
  20. package/build/src/compiler/keys.js.map +1 -1
  21. package/build/src/compiler/layr.d.ts +12 -10
  22. package/build/src/compiler/layr.d.ts.map +1 -1
  23. package/build/src/compiler/layr.js +83 -81
  24. package/build/src/compiler/layr.js.map +1 -1
  25. package/build/src/compiler/ldml-compiler-options.d.ts +10 -0
  26. package/build/src/compiler/ldml-compiler-options.d.ts.map +1 -0
  27. package/build/src/compiler/ldml-compiler-options.js +5 -0
  28. package/build/src/compiler/ldml-compiler-options.js.map +1 -0
  29. package/build/src/compiler/loca.d.ts +18 -16
  30. package/build/src/compiler/loca.d.ts.map +1 -1
  31. package/build/src/compiler/loca.js +61 -59
  32. package/build/src/compiler/loca.js.map +1 -1
  33. package/build/src/compiler/marker-tracker.d.ts +36 -34
  34. package/build/src/compiler/marker-tracker.d.ts.map +1 -1
  35. package/build/src/compiler/marker-tracker.js +75 -73
  36. package/build/src/compiler/marker-tracker.js.map +1 -1
  37. package/build/src/compiler/messages.d.ts +135 -133
  38. package/build/src/compiler/messages.d.ts.map +1 -1
  39. package/build/src/compiler/messages.js +79 -77
  40. package/build/src/compiler/messages.js.map +1 -1
  41. package/build/src/compiler/meta.d.ts +14 -12
  42. package/build/src/compiler/meta.d.ts.map +1 -1
  43. package/build/src/compiler/meta.js +60 -58
  44. package/build/src/compiler/meta.js.map +1 -1
  45. package/build/src/compiler/metadata-compiler.d.ts +15 -13
  46. package/build/src/compiler/metadata-compiler.d.ts.map +1 -1
  47. package/build/src/compiler/metadata-compiler.js +49 -47
  48. package/build/src/compiler/metadata-compiler.js.map +1 -1
  49. package/build/src/compiler/name.d.ts +12 -10
  50. package/build/src/compiler/name.d.ts.map +1 -1
  51. package/build/src/compiler/name.js +22 -20
  52. package/build/src/compiler/name.js.map +1 -1
  53. package/build/src/compiler/section-compiler.d.ts +18 -16
  54. package/build/src/compiler/section-compiler.d.ts.map +1 -1
  55. package/build/src/compiler/section-compiler.js +36 -34
  56. package/build/src/compiler/section-compiler.js.map +1 -1
  57. package/build/src/compiler/touch-layout-compiler.d.ts +10 -8
  58. package/build/src/compiler/touch-layout-compiler.d.ts.map +1 -1
  59. package/build/src/compiler/touch-layout-compiler.js +89 -87
  60. package/build/src/compiler/touch-layout-compiler.js.map +1 -1
  61. package/build/src/compiler/tran.d.ts +39 -37
  62. package/build/src/compiler/tran.d.ts.map +1 -1
  63. package/build/src/compiler/tran.js +187 -185
  64. package/build/src/compiler/tran.js.map +1 -1
  65. package/build/src/compiler/vars.d.ts +23 -21
  66. package/build/src/compiler/vars.d.ts.map +1 -1
  67. package/build/src/compiler/vars.js +221 -219
  68. package/build/src/compiler/vars.js.map +1 -1
  69. package/build/src/compiler/visual-keyboard-compiler.d.ts +9 -7
  70. package/build/src/compiler/visual-keyboard-compiler.d.ts.map +1 -1
  71. package/build/src/compiler/visual-keyboard-compiler.js +52 -54
  72. package/build/src/compiler/visual-keyboard-compiler.js.map +1 -1
  73. package/build/src/compiler/vkey.d.ts +11 -9
  74. package/build/src/compiler/vkey.d.ts.map +1 -1
  75. package/build/src/compiler/vkey.js +61 -59
  76. package/build/src/compiler/vkey.js.map +1 -1
  77. package/build/src/main.d.ts +11 -9
  78. package/build/src/main.d.ts.map +1 -1
  79. package/build/src/main.js +10 -8
  80. package/build/src/main.js.map +1 -1
  81. package/build/src/util/util.d.ts +44 -42
  82. package/build/src/util/util.d.ts.map +1 -1
  83. package/build/src/util/util.js +122 -120
  84. package/build/src/util/util.js.map +1 -1
  85. package/package.json +8 -8
  86. package/build/src/compiler/compiler-options.d.ts +0 -16
  87. package/build/src/compiler/compiler-options.d.ts.map +0 -1
  88. package/build/src/compiler/compiler-options.js +0 -6
  89. package/build/src/compiler/compiler-options.js.map +0 -1
  90. package/build/src/kpj.schema.json +0 -127
  91. package/build/src/kvks.schema.json +0 -182
  92. package/build/src/ldml-keyboard.schema.json +0 -702
  93. package/build/src/ldml-keyboardtest.schema.json +0 -221
@@ -1,55 +1,57 @@
1
- import { LDMLKeyboard, KMXPlus, CompilerCallbacks, LDMLKeyboardTestDataXMLSourceFile, UnicodeSetParser } from '@keymanapp/common-types';
2
- import { CompilerOptions } from './compiler-options.js';
3
- import { BkspCompiler, TranCompiler } from './tran.js';
4
- import { DispCompiler } from './disp.js';
5
- import { KeysCompiler } from './keys.js';
6
- import { LayrCompiler } from './layr.js';
7
- import { LocaCompiler } from './loca.js';
8
- import { MetaCompiler } from './meta.js';
9
- import { NameCompiler } from './name.js';
10
- import { VkeyCompiler } from './vkey.js';
11
- import { VarsCompiler } from './vars.js';
12
- import { StrsCompiler } from './empty-compiler.js';
13
- import LDMLKeyboardXMLSourceFile = LDMLKeyboard.LDMLKeyboardXMLSourceFile;
14
- export declare const SECTION_COMPILERS: (typeof TranCompiler | typeof BkspCompiler | typeof DispCompiler | typeof KeysCompiler | typeof LayrCompiler | typeof LocaCompiler | typeof MetaCompiler | typeof NameCompiler | typeof VkeyCompiler | typeof VarsCompiler | typeof StrsCompiler)[];
15
- export declare class LdmlKeyboardCompiler {
16
- private readonly callbacks;
17
- private readonly options;
18
- private usetparser?;
19
- constructor(callbacks: CompilerCallbacks, options: CompilerOptions);
20
- /**
21
- * Construct or return a UnicodeSetParser, aka KmnCompiler
22
- * @returns the held UnicodeSetParser
23
- */
24
- getUsetParser(): Promise<UnicodeSetParser>;
25
- private buildSections;
26
- /**
27
- * Loads a LDML Keyboard xml file and compiles into in-memory xml
28
- * structures.
29
- * @param filename input filename, will use callback to load from disk
30
- * @returns the source file, or null if invalid
31
- */
32
- load(filename: string): LDMLKeyboardXMLSourceFile | null;
33
- /**
34
- * Loads a LDML Keyboard test data xml file and compiles into in-memory xml
35
- * structures.
36
- * @param filename input filename, will use callback to load from disk
37
- * @returns the source file, or null if invalid
38
- */
39
- loadTestData(filename: string): LDMLKeyboardTestDataXMLSourceFile | null;
40
- /**
41
- * Validates that the LDML keyboard source file and lints. Actually just
42
- * compiles the keyboard and returns `true` if everything is good...
43
- * @param source
44
- * @returns true if the file validates
45
- */
46
- validate(source: LDMLKeyboardXMLSourceFile): boolean;
47
- /**
48
- * Transforms in-memory LDML keyboard xml file to an intermediate
49
- * representation of a .kmx file.
50
- * @param source in-memory representation of LDML keyboard xml file
51
- * @returns KMXPlusFile intermediate file
52
- */
53
- compile(source: LDMLKeyboardXMLSourceFile): Promise<KMXPlus.KMXPlusFile>;
54
- }
55
- //# sourceMappingURL=compiler.d.ts.map
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bbad84b1-d211-555b-af5a-8b1acd488164")}catch(e){}}();
2
+ import { LDMLKeyboard, KMXPlus, CompilerCallbacks, LDMLKeyboardTestDataXMLSourceFile, UnicodeSetParser } from '@keymanapp/common-types';
3
+ import { LdmlCompilerOptions } from './ldml-compiler-options.js';
4
+ import { BkspCompiler, TranCompiler } from './tran.js';
5
+ import { DispCompiler } from './disp.js';
6
+ import { KeysCompiler } from './keys.js';
7
+ import { LayrCompiler } from './layr.js';
8
+ import { LocaCompiler } from './loca.js';
9
+ import { MetaCompiler } from './meta.js';
10
+ import { NameCompiler } from './name.js';
11
+ import { VkeyCompiler } from './vkey.js';
12
+ import { VarsCompiler } from './vars.js';
13
+ import { StrsCompiler } from './empty-compiler.js';
14
+ import LDMLKeyboardXMLSourceFile = LDMLKeyboard.LDMLKeyboardXMLSourceFile;
15
+ export declare const SECTION_COMPILERS: (typeof TranCompiler | typeof BkspCompiler | typeof DispCompiler | typeof KeysCompiler | typeof LayrCompiler | typeof LocaCompiler | typeof MetaCompiler | typeof NameCompiler | typeof VkeyCompiler | typeof VarsCompiler | typeof StrsCompiler)[];
16
+ export declare class LdmlKeyboardCompiler {
17
+ private readonly callbacks;
18
+ private readonly options;
19
+ private usetparser?;
20
+ constructor(callbacks: CompilerCallbacks, options: LdmlCompilerOptions);
21
+ /**
22
+ * Construct or return a UnicodeSetParser, aka KmnCompiler
23
+ * @returns the held UnicodeSetParser
24
+ */
25
+ getUsetParser(): Promise<UnicodeSetParser>;
26
+ private buildSections;
27
+ /**
28
+ * Loads a LDML Keyboard xml file and compiles into in-memory xml
29
+ * structures.
30
+ * @param filename input filename, will use callback to load from disk
31
+ * @returns the source file, or null if invalid
32
+ */
33
+ load(filename: string): LDMLKeyboardXMLSourceFile | null;
34
+ /**
35
+ * Loads a LDML Keyboard test data xml file and compiles into in-memory xml
36
+ * structures.
37
+ * @param filename input filename, will use callback to load from disk
38
+ * @returns the source file, or null if invalid
39
+ */
40
+ loadTestData(filename: string): LDMLKeyboardTestDataXMLSourceFile | null;
41
+ /**
42
+ * Validates that the LDML keyboard source file and lints. Actually just
43
+ * compiles the keyboard and returns `true` if everything is good...
44
+ * @param source
45
+ * @returns true if the file validates
46
+ */
47
+ validate(source: LDMLKeyboardXMLSourceFile): boolean;
48
+ /**
49
+ * Transforms in-memory LDML keyboard xml file to an intermediate
50
+ * representation of a .kmx file.
51
+ * @param source in-memory representation of LDML keyboard xml file
52
+ * @returns KMXPlusFile intermediate file
53
+ */
54
+ compile(source: LDMLKeyboardXMLSourceFile): Promise<KMXPlus.KMXPlusFile>;
55
+ }
56
+ //# debugId=bbad84b1-d211-555b-af5a-8b1acd488164
57
+ //# sourceMappingURL=compiler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../../src/compiler/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,YAAY,EAAE,OAAO,EAAE,iBAAiB,EAAE,iCAAiC,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACzK,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAA4C,MAAM,qBAAqB,CAAC;AAG7F,OAAO,yBAAyB,GAAG,YAAY,CAAC,yBAAyB,CAAC;AAM1E,eAAO,MAAM,iBAAiB,qPAoB7B,CAAC;AAEF,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,C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AM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAA4C,MAAM,qBAAqB,CAAC;AAG7F,OAAO,yBAAyB,GAAG,YAAY,CAAC,yBAAyB,CAAC;AAM1E,eAAO,MAAM,iBAAiB,qPAoB7B,CAAC;AAEF,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAG9C,OAAO,CAAC,UAAU,CAAC,CAA+B;gBAErC,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,mBAAmB;IAOvE;;;OAGG;IACG,aAAa,IAAK,OAAO,CAAC,gBAAgB,CAAC;IAejD,OAAO,CAAC,aAAa;IAIrB;;;;;OAKG;IACI,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,yBAAyB,GAAG,IAAI;IA2B/D;;;;;OAKG;IACM,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,iCAAiC,GAAG,IAAI;IA4BjF;;;;;OAKG;IACI,QAAQ,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO;IAI3D;;;;;OAKG;IACU,OAAO,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC;CAoDtF","names":[],"sourceRoot":"","sources":["../../../src/compiler/compiler.ts"],"version":3}
@@ -1,198 +1,198 @@
1
- import { LDMLKeyboardXMLSourceFileReader, KMXPlus } from '@keymanapp/common-types';
2
- import { CompilerMessages } from './messages.js';
3
- import { BkspCompiler, TranCompiler } from './tran.js';
4
- import { DispCompiler } from './disp.js';
5
- import { KeysCompiler } from './keys.js';
6
- import { LayrCompiler } from './layr.js';
7
- import { LocaCompiler } from './loca.js';
8
- import { MetaCompiler } from './meta.js';
9
- import { NameCompiler } from './name.js';
10
- import { VkeyCompiler } from './vkey.js';
11
- import { VarsCompiler } from './vars.js';
12
- import { StrsCompiler, ElemCompiler, ListCompiler, UsetCompiler } from './empty-compiler.js';
13
- var KMXPlusFile = KMXPlus.KMXPlusFile;
14
- import { constants } from '@keymanapp/ldml-keyboard-constants';
15
- import { KmnCompiler } from '@keymanapp/kmc-kmn';
16
- export const SECTION_COMPILERS = [
17
- // These are in dependency order.
18
- // First the former 'global' sections
19
- StrsCompiler,
20
- ListCompiler,
21
- ElemCompiler,
22
- UsetCompiler,
23
- // Next, Vars, which depends on others
24
- VarsCompiler,
25
- // Now all others:
26
- BkspCompiler,
27
- DispCompiler,
28
- KeysCompiler,
29
- LayrCompiler,
30
- LocaCompiler,
31
- MetaCompiler,
32
- NameCompiler,
33
- TranCompiler,
34
- VkeyCompiler,
35
- ];
36
- export class LdmlKeyboardCompiler {
37
- callbacks;
38
- options;
39
- // uset parser
40
- usetparser = undefined;
41
- constructor(callbacks, options) {
42
- this.options = {
43
- debug: false,
44
- addCompilerVersion: true,
45
- ...options
46
- };
47
- this.callbacks = callbacks;
48
- }
49
- /**
50
- * Construct or return a UnicodeSetParser, aka KmnCompiler
51
- * @returns the held UnicodeSetParser
52
- */
53
- async getUsetParser() {
54
- if (this.usetparser === undefined) {
55
- // initialize
56
- const compiler = new KmnCompiler();
57
- const ok = await compiler.init(this.callbacks);
58
- if (ok) {
59
- this.usetparser = compiler;
60
- }
61
- else {
62
- /* c8 ignore next 2 */
63
- this.usetparser = null; // Store null on failure
64
- }
65
- }
66
- return this.usetparser;
67
- }
68
- buildSections(source) {
69
- return SECTION_COMPILERS.map(c => new c(source, this.callbacks));
70
- }
71
- /**
72
- * Loads a LDML Keyboard xml file and compiles into in-memory xml
73
- * structures.
74
- * @param filename input filename, will use callback to load from disk
75
- * @returns the source file, or null if invalid
76
- */
77
- load(filename) {
78
- const reader = new LDMLKeyboardXMLSourceFileReader(this.options.readerOptions, this.callbacks);
79
- // load the file from disk into a string
80
- const data = this.callbacks.loadFile(filename);
81
- if (!data) {
82
- this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({ errorText: 'Unable to read XML file' }));
83
- return null;
84
- }
85
- // parse (load) the string into an object tree
86
- const source = reader.load(data);
87
- if (!source) {
88
- this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({ errorText: 'Unable to load XML file' }));
89
- return null;
90
- }
91
- try {
92
- // validate the object tree against the .xsd schema
93
- if (!reader.validate(source, this.callbacks.loadSchema('ldml-keyboard'))) {
94
- return null;
95
- }
96
- }
97
- catch (e) {
98
- this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({ errorText: e.toString() }));
99
- return null;
100
- }
101
- return source;
102
- }
103
- /**
104
- * Loads a LDML Keyboard test data xml file and compiles into in-memory xml
105
- * structures.
106
- * @param filename input filename, will use callback to load from disk
107
- * @returns the source file, or null if invalid
108
- */
109
- loadTestData(filename) {
110
- const reader = new LDMLKeyboardXMLSourceFileReader(this.options.readerOptions, this.callbacks);
111
- const data = this.callbacks.loadFile(filename);
112
- if (!data) {
113
- this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({ errorText: 'Unable to read XML file' }));
114
- return null;
115
- }
116
- const source = reader.loadTestData(data);
117
- /* c8 ignore next 4 */
118
- if (!source) {
119
- this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({ errorText: 'Unable to load XML file' }));
120
- return null;
121
- }
122
- // TODO-LDML: The unboxed data doesn't match the schema anymore. Skipping validation, for now.
123
- // try {
124
- // if (!reader.validate(source, this.callbacks.loadSchema('ldml-keyboard-test'))) {
125
- // return null;
126
- // }
127
- // } catch(e) {
128
- // this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({errorText: e.toString()}));
129
- // return null;
130
- // }
131
- return source;
132
- }
133
- /**
134
- * Validates that the LDML keyboard source file and lints. Actually just
135
- * compiles the keyboard and returns `true` if everything is good...
136
- * @param source
137
- * @returns true if the file validates
138
- */
139
- validate(source) {
140
- return !!this.compile(source);
141
- }
142
- /**
143
- * Transforms in-memory LDML keyboard xml file to an intermediate
144
- * representation of a .kmx file.
145
- * @param source in-memory representation of LDML keyboard xml file
146
- * @returns KMXPlusFile intermediate file
147
- */
148
- async compile(source) {
149
- const sections = this.buildSections(source);
150
- let passed = true;
151
- const kmx = new KMXPlusFile();
152
- for (let section of sections) {
153
- if (!section.validate()) {
154
- // TODO-LDML: coverage
155
- passed = false;
156
- // We'll keep validating other sections anyway, so we get a full set of
157
- // errors for the keyboard developer.
158
- continue;
159
- }
160
- // clone
161
- const globalSections = Object.assign({}, kmx.kmxplus);
162
- // pre-initialize the usetparser
163
- globalSections.usetparser = await this.getUsetParser();
164
- const dependencies = section.dependencies;
165
- Object.keys(constants.section).forEach((sectstr) => {
166
- const sectid = constants.section[sectstr];
167
- if (dependencies.has(sectid)) {
168
- /* c8 ignore next 4 */
169
- if (!kmx.kmxplus[sectid]) {
170
- // Internal error useful during section bring-up
171
- throw new Error(`Internal error: section ${section.id} depends on uninitialized dependency ${sectid}, check ordering`);
172
- }
173
- }
174
- else {
175
- // delete dependencies that aren't referenced
176
- delete globalSections[sectid];
177
- }
178
- });
179
- const sect = section.compile(globalSections);
180
- /* c8 ignore next 7 */
181
- if (!sect) {
182
- // This should not happen -- validate() should have told us
183
- // if something is going to fail to compile
184
- this.callbacks.reportMessage(CompilerMessages.Fatal_SectionCompilerFailed({ sect: section.id }));
185
- passed = false;
186
- continue;
187
- }
188
- /* c8 ignore next 4 */
189
- if (kmx.kmxplus[section.id]) {
190
- // Internal error useful during section bring-up
191
- throw new Error(`Internal error: section ${section.id} would be assigned twice`);
192
- }
193
- kmx.kmxplus[section.id] = sect;
194
- }
195
- return passed ? kmx : null;
196
- }
197
- }
198
- //# sourceMappingURL=compiler.js.map
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4e3d1809-18d8-5297-8fa0-4f1418f31976")}catch(e){}}();
2
+ import { LDMLKeyboardXMLSourceFileReader, KMXPlus } from '@keymanapp/common-types';
3
+ import { CompilerMessages } from './messages.js';
4
+ import { BkspCompiler, TranCompiler } from './tran.js';
5
+ import { DispCompiler } from './disp.js';
6
+ import { KeysCompiler } from './keys.js';
7
+ import { LayrCompiler } from './layr.js';
8
+ import { LocaCompiler } from './loca.js';
9
+ import { MetaCompiler } from './meta.js';
10
+ import { NameCompiler } from './name.js';
11
+ import { VkeyCompiler } from './vkey.js';
12
+ import { VarsCompiler } from './vars.js';
13
+ import { StrsCompiler, ElemCompiler, ListCompiler, UsetCompiler } from './empty-compiler.js';
14
+ var KMXPlusFile = KMXPlus.KMXPlusFile;
15
+ import { constants } from '@keymanapp/ldml-keyboard-constants';
16
+ import { KmnCompiler } from '@keymanapp/kmc-kmn';
17
+ export const SECTION_COMPILERS = [
18
+ // These are in dependency order.
19
+ // First the former 'global' sections
20
+ StrsCompiler,
21
+ ListCompiler,
22
+ ElemCompiler,
23
+ UsetCompiler,
24
+ // Next, Vars, which depends on others
25
+ VarsCompiler,
26
+ // Now all others:
27
+ BkspCompiler,
28
+ DispCompiler,
29
+ KeysCompiler,
30
+ LayrCompiler,
31
+ LocaCompiler,
32
+ MetaCompiler,
33
+ NameCompiler,
34
+ TranCompiler,
35
+ VkeyCompiler,
36
+ ];
37
+ export class LdmlKeyboardCompiler {
38
+ callbacks;
39
+ options;
40
+ // uset parser
41
+ usetparser = undefined;
42
+ constructor(callbacks, options) {
43
+ this.options = {
44
+ ...options
45
+ };
46
+ this.callbacks = callbacks;
47
+ }
48
+ /**
49
+ * Construct or return a UnicodeSetParser, aka KmnCompiler
50
+ * @returns the held UnicodeSetParser
51
+ */
52
+ async getUsetParser() {
53
+ if (this.usetparser === undefined) {
54
+ // initialize
55
+ const compiler = new KmnCompiler();
56
+ const ok = await compiler.init(this.callbacks);
57
+ if (ok) {
58
+ this.usetparser = compiler;
59
+ }
60
+ else {
61
+ /* c8 ignore next 2 */
62
+ this.usetparser = null; // Store null on failure
63
+ }
64
+ }
65
+ return this.usetparser;
66
+ }
67
+ buildSections(source) {
68
+ return SECTION_COMPILERS.map(c => new c(source, this.callbacks));
69
+ }
70
+ /**
71
+ * Loads a LDML Keyboard xml file and compiles into in-memory xml
72
+ * structures.
73
+ * @param filename input filename, will use callback to load from disk
74
+ * @returns the source file, or null if invalid
75
+ */
76
+ load(filename) {
77
+ const reader = new LDMLKeyboardXMLSourceFileReader(this.options.readerOptions, this.callbacks);
78
+ // load the file from disk into a string
79
+ const data = this.callbacks.loadFile(filename);
80
+ if (!data) {
81
+ this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({ errorText: 'Unable to read XML file' }));
82
+ return null;
83
+ }
84
+ // parse (load) the string into an object tree
85
+ const source = reader.load(data);
86
+ if (!source) {
87
+ this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({ errorText: 'Unable to load XML file' }));
88
+ return null;
89
+ }
90
+ try {
91
+ // validate the object tree against the .xsd schema
92
+ if (!reader.validate(source)) {
93
+ return null;
94
+ }
95
+ }
96
+ catch (e) {
97
+ this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({ errorText: e.toString() }));
98
+ return null;
99
+ }
100
+ return source;
101
+ }
102
+ /**
103
+ * Loads a LDML Keyboard test data xml file and compiles into in-memory xml
104
+ * structures.
105
+ * @param filename input filename, will use callback to load from disk
106
+ * @returns the source file, or null if invalid
107
+ */
108
+ loadTestData(filename) {
109
+ const reader = new LDMLKeyboardXMLSourceFileReader(this.options.readerOptions, this.callbacks);
110
+ const data = this.callbacks.loadFile(filename);
111
+ if (!data) {
112
+ this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({ errorText: 'Unable to read XML file' }));
113
+ return null;
114
+ }
115
+ const source = reader.loadTestData(data);
116
+ /* c8 ignore next 4 */
117
+ if (!source) {
118
+ this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({ errorText: 'Unable to load XML file' }));
119
+ return null;
120
+ }
121
+ // TODO-LDML: The unboxed data doesn't match the schema anymore. Skipping validation, for now.
122
+ // try {
123
+ // if (!reader.validate(source)) {
124
+ // return null;
125
+ // }
126
+ // } catch(e) {
127
+ // this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({errorText: e.toString()}));
128
+ // return null;
129
+ // }
130
+ return source;
131
+ }
132
+ /**
133
+ * Validates that the LDML keyboard source file and lints. Actually just
134
+ * compiles the keyboard and returns `true` if everything is good...
135
+ * @param source
136
+ * @returns true if the file validates
137
+ */
138
+ validate(source) {
139
+ return !!this.compile(source);
140
+ }
141
+ /**
142
+ * Transforms in-memory LDML keyboard xml file to an intermediate
143
+ * representation of a .kmx file.
144
+ * @param source in-memory representation of LDML keyboard xml file
145
+ * @returns KMXPlusFile intermediate file
146
+ */
147
+ async compile(source) {
148
+ const sections = this.buildSections(source);
149
+ let passed = true;
150
+ const kmx = new KMXPlusFile();
151
+ for (let section of sections) {
152
+ if (!section.validate()) {
153
+ // TODO-LDML: coverage
154
+ passed = false;
155
+ // We'll keep validating other sections anyway, so we get a full set of
156
+ // errors for the keyboard developer.
157
+ continue;
158
+ }
159
+ // clone
160
+ const globalSections = Object.assign({}, kmx.kmxplus);
161
+ // pre-initialize the usetparser
162
+ globalSections.usetparser = await this.getUsetParser();
163
+ const dependencies = section.dependencies;
164
+ Object.keys(constants.section).forEach((sectstr) => {
165
+ const sectid = constants.section[sectstr];
166
+ if (dependencies.has(sectid)) {
167
+ /* c8 ignore next 4 */
168
+ if (!kmx.kmxplus[sectid]) {
169
+ // Internal error useful during section bring-up
170
+ throw new Error(`Internal error: section ${section.id} depends on uninitialized dependency ${sectid}, check ordering`);
171
+ }
172
+ }
173
+ else {
174
+ // delete dependencies that aren't referenced
175
+ delete globalSections[sectid];
176
+ }
177
+ });
178
+ const sect = section.compile(globalSections);
179
+ /* c8 ignore next 7 */
180
+ if (!sect) {
181
+ // This should not happen -- validate() should have told us
182
+ // if something is going to fail to compile
183
+ this.callbacks.reportMessage(CompilerMessages.Fatal_SectionCompilerFailed({ sect: section.id }));
184
+ passed = false;
185
+ continue;
186
+ }
187
+ /* c8 ignore next 4 */
188
+ if (kmx.kmxplus[section.id]) {
189
+ // Internal error useful during section bring-up
190
+ throw new Error(`Internal error: section ${section.id} would be assigned twice`);
191
+ }
192
+ kmx.kmxplus[section.id] = sect;
193
+ }
194
+ return passed ? kmx : null;
195
+ }
196
+ }
197
+ //# debugId=4e3d1809-18d8-5297-8fa0-4f1418f31976
198
+ //# sourceMappingURL=compiler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../../src/compiler/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAgB,OAAO,EAA0E,MAAM,yBAAyB,CAAC;AAEzK,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAI7F,IAAO,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;AAEzC,OAAO,EAAgB,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,iCAAiC;IAEjC,qCAAqC;IACrC,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,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AAgD;wBAChD,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,CAAC,EAAE,wCAAwC,MAAM,kBAAkB,CAAC,CAAC;qBACxH;iBACF;qBAAM;oBACL,6CAA6C;oBAC7C,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;iBAC/B;YACH,CAAC,CAAC,CAAC;YACH,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;YAE7C,sBAAsB;YACtB,IAAG,CAAC,IAAI,EAAE;gBACR,2DAA2D;gBAC3D,2CAA2C;gBAC3C,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,gBAAgB,CAAC,2BAA2B,CAAC,EAAC,IAAI,EAAC,OAAO,CAAC,EAAE,EAAC,CAAC,CAAC,CAAC;gBAC9F,MAAM,GAAG,KAAK,CAAC;gBACf,SAAS;aACV;YACD,sBAAsB;YACtB,IAAG,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;gBAC1B,gDAAgD;gBAChD,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,CAAC,EAAE,0BAA0B,CAAC,CAAC;aAClF;YACD,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,IAAW,CAAC;SACvC;QAED,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7B,CAAC;CACF","names":[],"sourceRoot":"","sources":["../../../src/compiler/compiler.ts"],"version":3}
@@ -1,12 +1,14 @@
1
- import { KMXPlus, LDMLKeyboard } from '@keymanapp/common-types';
2
- import { SectionCompiler } from "./section-compiler.js";
3
- import DependencySections = KMXPlus.DependencySections;
4
- import Disp = KMXPlus.Disp;
5
- import { MarkerTracker } from "./marker-tracker.js";
6
- export declare class DispCompiler extends SectionCompiler {
7
- static validateMarkers(keyboard: LDMLKeyboard.LKKeyboard, mt: MarkerTracker): boolean;
8
- get id(): import("@keymanapp/ldml-keyboard-constants").SectionIdent;
9
- validate(): boolean;
10
- compile(sections: DependencySections): Disp;
11
- }
12
- //# sourceMappingURL=disp.d.ts.map
1
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="173fb484-340b-5d86-9c83-d1d18b16f9f4")}catch(e){}}();
2
+ import { KMXPlus, LDMLKeyboard } from '@keymanapp/common-types';
3
+ import { SectionCompiler } from "./section-compiler.js";
4
+ import DependencySections = KMXPlus.DependencySections;
5
+ import Disp = KMXPlus.Disp;
6
+ import { MarkerTracker } from "./marker-tracker.js";
7
+ export declare class DispCompiler extends SectionCompiler {
8
+ static validateMarkers(keyboard: LDMLKeyboard.LKKeyboard, mt: MarkerTracker): boolean;
9
+ get id(): import("@keymanapp/ldml-keyboard-constants").SectionIdent;
10
+ validate(): boolean;
11
+ compile(sections: DependencySections): Disp;
12
+ }
13
+ //# debugId=173fb484-340b-5d86-9c83-d1d18b16f9f4
14
+ //# sourceMappingURL=disp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"disp.d.ts","sourceRoot":"","sources":["../../../src/compiler/disp.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAgB,MAAM,yBAAyB,CAAC;AAG9E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AACvD,OAAO,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAa,MAAM,qBAAqB,CAAC;AAE/D,qBAAa,YAAa,SAAQ,eAAe;IAC/C,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,YAAY,CAAC,UAAU,EAAE,EAAE,EAAG,aAAa,GAAG,OAAO;IAMtF,IAAW,EAAE,8DAEZ;IAEM,QAAQ,IAAI,OAAO;IAkBnB,OAAO,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;CAkBnD"}
1
+ {"debug_id":"173fb484-340b-5d86-9c83-d1d18b16f9f4","file":"disp.d.ts","mappings":";AACA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAgB,MAAM,yBAAyB,CAAC;AAG9E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;AACvD,OAAO,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAa,MAAM,qBAAqB,CAAC;AAE/D,qBAAa,YAAa,SAAQ,eAAe;IAC/C,MAAM,CAAC,eAAe,CAAC,QAAQ,EAAE,YAAY,CAAC,UAAU,EAAE,EAAE,EAAG,aAAa,GAAG,OAAO;IAMtF,IAAW,EAAE,8DAEZ;IAEM,QAAQ,IAAI,OAAO;IAkBnB,OAAO,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;CAkBnD","names":[],"sourceRoot":"","sources":["../../../src/compiler/disp.ts"],"version":3}