@keymanapp/kmc-kmn 18.0.8-alpha → 18.0.10-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.
@@ -1,11 +1,21 @@
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]="33058ebc-c7fb-59ed-aa87-4aba9b54b603")}catch(e){}}();
2
- import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageSpec as m } from "@keymanapp/common-types";
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]="e2a9d11c-b57d-5232-9f5e-567fd78fb207")}catch(e){}}();
2
+ import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageSpec as m, CompilerMessageDef as def, CompilerMessageSpecWithException } from "@keymanapp/common-types";
3
+ import { kmnfile } from "../kmw-compiler/compiler-globals.js";
4
+ import { KeymanUrls } from "@keymanapp/developer-utils";
3
5
  const Namespace = CompilerErrorNamespace.KmnCompiler;
4
6
  const SevInfo = CompilerErrorSeverity.Info | Namespace;
5
7
  const SevHint = CompilerErrorSeverity.Hint | Namespace;
6
8
  const SevWarn = CompilerErrorSeverity.Warn | Namespace;
7
9
  const SevError = CompilerErrorSeverity.Error | Namespace;
8
10
  const SevFatal = CompilerErrorSeverity.Fatal | Namespace;
11
+ // For messages from the KeymanWeb compiler, we need to construct our messages
12
+ // slightly differently. This could be refactored in the future, as it is not
13
+ // obvious which messages should use which function.
14
+ const mw = (code, message, o) => ({
15
+ ...m(code, message),
16
+ filename: o?.filename ?? kmnfile,
17
+ line: o?.line,
18
+ });
9
19
  /**
10
20
  * LogLevel comes from kmn_compiler_errors.h, for legacy compiler error messages
11
21
  */
@@ -39,220 +49,432 @@ export var KmnCompilerMessageRanges;
39
49
  KmnCompilerMessageRanges[KmnCompilerMessageRanges["RANGE_CompilerMessage_Min"] = 2304] = "RANGE_CompilerMessage_Min";
40
50
  KmnCompilerMessageRanges[KmnCompilerMessageRanges["RANGE_CompilerMessage_Max"] = 4095] = "RANGE_CompilerMessage_Max";
41
51
  })(KmnCompilerMessageRanges || (KmnCompilerMessageRanges = {}));
42
- /*
43
- The messages in this class share the namespace with messages from
44
- kmn_compiler_errors.h, which are generated by kmcmplib, so values below 0x900
45
- are reserved for kmcmplib messages.
46
- */
47
- export class CompilerMessages {
48
- static Fatal_UnexpectedException = (o) => m(this.FATAL_UnexpectedException, null, o.e ?? 'unknown error');
52
+ /**
53
+ * @internal
54
+ *
55
+ * Error messages reported by the .kmn compiler. The error codes in this class
56
+ * share an address space with messages from kmn_compiler_errors.h, which are
57
+ * generated by kmcmplib, so codes below 0x900 are reserved for kmcmplib
58
+ * messages.
59
+ *
60
+ * The second half of this class defines the messages from kmcmplib. These
61
+ * messages should correspond to codes in kmn_compiler_errors.h, exclusive
62
+ * severity bits. Message text is defined by kmcmplib and passed through a
63
+ * callback at this time. The message text presented here is currently unused
64
+ * during the compilation process, but is used in the `kmc messages` tool and
65
+ * for documentation.
66
+ *
67
+ * `CERR_` messages that are actually fatals have been renamed to `FATAL_`.
68
+ *
69
+ * @example
70
+ *
71
+ * ```
72
+ * kmcmplib.CERR_BadCallParams = CERR_FATAL | 0x002 = 0x8002
73
+ * ERROR_BadCallParams = SevError | 0x0002 = 0x300000 | 0x2000 | 0x002 = 0x302002
74
+ * ```
75
+ */
76
+ export class KmnCompilerMessages {
77
+ // TODO: v18.0 we should consider moving error message generation in kmcmplib to
78
+ // kmc-kmn, which would avoid a number of legacy issues. Questions about
79
+ // parameterisation.
49
80
  static FATAL_UnexpectedException = SevFatal | 0x900;
50
- static Fatal_MissingWasmModule = (o) => m(this.FATAL_MissingWasmModule, `Could not instantiate WASM compiler module or initialization failed`, o.e ?? 'unknown error');
81
+ static Fatal_UnexpectedException = (o) => CompilerMessageSpecWithException(this.FATAL_UnexpectedException, null, o.e ?? 'unknown error', `Raised when KmnCompiler or one of its components has an internal
82
+ error. If you experience this error, it should be reported to the Keyman
83
+ team for resolution via ${KeymanUrls.NEW_KEYMAN_ISSUE()}.`);
51
84
  static FATAL_MissingWasmModule = SevFatal | 0x901;
52
- // TODO: Is this now deprecated?
53
- static Fatal_UnableToSetCompilerOptions = () => m(this.FATAL_UnableToSetCompilerOptions, null, `Unable to set compiler options`);
54
- static FATAL_UnableToSetCompilerOptions = SevFatal | 0x902;
55
- static Fatal_CallbacksNotSet = () => m(this.FATAL_CallbacksNotSet, null, `Callbacks were not set with init`);
85
+ static Fatal_MissingWasmModule = (o) => CompilerMessageSpecWithException(this.FATAL_MissingWasmModule, `Could not instantiate WASM compiler module or initialization failed`, o.e ?? 'unknown error', `Raised when the kmcmplib component could not be instantiated. This may indicate
86
+ a configuration or dependency issue. Make sure you are running a Javascript
87
+ engine that supports WASM, and that use of WASM is enabled.`);
88
+ // Note: this is now unused
89
+ // static FATAL_UnableToSetCompilerOptions = SevFatal | 0x902;
90
+ // static Fatal_UnableToSetCompilerOptions = () => m(this.FATAL_UnableToSetCompilerOptions, null, `Unable to set compiler options`);
56
91
  static FATAL_CallbacksNotSet = SevFatal | 0x903;
57
- static Fatal_UnicodeSetOutOfRange = () => m(this.FATAL_UnicodeSetOutOfRange, null, `UnicodeSet buffer was too small`);
92
+ static Fatal_CallbacksNotSet = () => CompilerMessageSpecWithException(this.FATAL_CallbacksNotSet, null, `Callbacks were not set with init`, `Raised when KmnCompiler or one of its components experiences an internal
93
+ error. If you experience this error, it should be reported to the Keyman
94
+ team for resolution via ${KeymanUrls.NEW_KEYMAN_ISSUE()}.`);
58
95
  static FATAL_UnicodeSetOutOfRange = SevFatal | 0x904;
59
- static Error_UnicodeSetHasStrings = () => m(this.ERROR_UnicodeSetHasStrings, `UnicodeSet contains strings, not allowed`);
96
+ static Fatal_UnicodeSetOutOfRange = () => CompilerMessageSpecWithException(this.FATAL_UnicodeSetOutOfRange, null, `UnicodeSet buffer was too small`, `Raised when caller to UnicodeSet functions provides an invalid buffer. If
97
+ you experience this error, it should be reported to the Keyman team for
98
+ resolution via ${KeymanUrls.NEW_KEYMAN_ISSUE()}.`);
99
+ // TODO: rename the following functions to Error_UsetHasStrings etc
60
100
  static ERROR_UnicodeSetHasStrings = SevError | 0x905;
61
- static Error_UnicodeSetHasProperties = () => m(this.ERROR_UnicodeSetHasProperties, `UnicodeSet contains properties, not allowed`);
101
+ static Error_UnicodeSetHasStrings = () => m(this.ERROR_UnicodeSetHasStrings, `uset contains strings, not allowed`, `The provided uset uses multi-character strings, (\`{}\` notation, e.g.
102
+ \`[żġħ{ie}{għ}]\`. ). Although full UnicodeSets support strings, LDML
103
+ keyboards do not support multi-character strings in usets. To resolve this,
104
+ reformat the uset to avoid the use of multi-character strings.
105
+
106
+ More on uset: ${KeymanUrls.LDML_SPEC('element-uset')}`);
62
107
  static ERROR_UnicodeSetHasProperties = SevError | 0x906;
63
- static Error_UnicodeSetSyntaxError = () => m(this.ERROR_UnicodeSetSyntaxError, `UnicodeSet had a Syntax Error while parsing`);
108
+ static Error_UnicodeSetHasProperties = () => m(this.ERROR_UnicodeSetHasProperties, `uset contains properties, not allowed`, `The provided uset uses property notation (\`\\p{…}\` or \`[:…:]\`). LDML
109
+ keyboards do not support Unicode properties in usets, because that would
110
+ make implementations dependent on a particular version of Unicode. To
111
+ resolve this, reformat the uset to avoid the use of properties.
112
+
113
+ More on uset: ${KeymanUrls.LDML_SPEC('element-uset')}`);
64
114
  static ERROR_UnicodeSetSyntaxError = SevError | 0x907;
65
- static Error_InvalidKvksFile = (o) => m(this.ERROR_InvalidKvksFile, `Error encountered parsing ${o.filename}: ${o.e ?? 'unknown error'}`); // Note, not fatal, not reporting to Sentry
115
+ static Error_UnicodeSetSyntaxError = () => m(this.ERROR_UnicodeSetSyntaxError, `uset had a Syntax Error while parsing`, `The provided uset has a syntax error and could not be parsed. Verify the
116
+ format of the uset against the specification.
117
+
118
+ More on uset: ${KeymanUrls.LDML_SPEC('element-uset')}`);
66
119
  static ERROR_InvalidKvksFile = SevError | 0x908;
67
- static Warn_InvalidVkeyInKvksFile = (o) => m(this.WARN_InvalidVkeyInKvksFile, `Invalid virtual key ${o.invalidVkey} found in ${o.filename}`);
120
+ static Error_InvalidKvksFile = (o) => m(this.ERROR_InvalidKvksFile, `Error encountered parsing ${def(o.filename)}: ${o.e ?? 'unknown error'}`, // Note, not fatal, not reporting to Sentry
121
+ `The .kvks file could not be parsed because it was not a valid XML file.
122
+ There may be additional information in the error message to help you
123
+ resolve the error.
124
+
125
+ More on .kvks file format: ${KeymanUrls.FILE_TYPE('kvks')}`);
68
126
  static WARN_InvalidVkeyInKvksFile = SevWarn | 0x909;
69
- static Error_InvalidDisplayMapFile = (o) => m(this.ERROR_InvalidDisplayMapFile, `Error encountered parsing display map ${o.filename}: ${o.e ?? 'unknown error'}`); // Note, not fatal, not reporting to Sentry
127
+ static Warn_InvalidVkeyInKvksFile = (o) => m(this.WARN_InvalidVkeyInKvksFile, `Invalid virtual key ${def(o.invalidVkey)} found in ${def(o.filename)}`, `The .kvks file contained a virtual key that was not supported by
128
+ Keyman. Remove this virtual key from the .kvks file.
129
+
130
+ Supported virtual keys: ${KeymanUrls.VIRTUAL_KEYS()}`);
70
131
  static ERROR_InvalidDisplayMapFile = SevError | 0x90A;
71
- static Error_InvalidKvkFile = (o) => m(this.ERROR_InvalidKvkFile, `Error encountered loading ${o.filename}: ${o.e ?? 'unknown error'}`); // Note, not fatal, not reporting to Sentry
132
+ static Error_InvalidDisplayMapFile = (o) => m(this.ERROR_InvalidDisplayMapFile, `Error encountered parsing display map ${def(o.filename)}: ${o.e ?? 'unknown error'}`, // Note, not fatal, not reporting to Sentry
133
+ `The displayMap file could not be parsed because it was not a valid JSON
134
+ file. There may be additional information in the error message to help you
135
+ resolve the error.
136
+
137
+ More on displayMap: ${KeymanUrls.KMN_REF('displaymap')}`);
72
138
  static ERROR_InvalidKvkFile = SevError | 0x90B;
73
- static Error_FileNotFound = (o) => m(this.ERROR_FileNotFound, `File ${o.filename} was not found`);
139
+ static Error_InvalidKvkFile = (o) => m(this.ERROR_InvalidKvkFile, `Error encountered loading ${def(o.filename)}: ${o.e ?? 'unknown error'}`, // Note, not fatal, not reporting to Sentry
140
+ `The .kvk file could not be loaded because it was not a valid format. There
141
+ may be additional information in the error message to help you resolve the
142
+ error.
143
+
144
+ More on .kvk files: ${KeymanUrls.FILE_TYPE('kvk')}`);
74
145
  static ERROR_FileNotFound = SevError | 0x90C;
75
- }
76
- ;
77
- /**
78
- * This class defines messages from kmcmplib. They should correspond to codes in
79
- * kmn_compiler_errors.h, exclusive severity bits. For example:
80
- *
81
- * ```
82
- * kmcmplib.CERR_BadCallParams = CERR_FATAL | 0x002 = 0x8002
83
- * ERROR_BadCallParams = SevError | 0x0002 = 0x300000 | 0x2000 | 0x002 = 0x302002
84
- * ```
85
- *
86
- * CERR_ messages that are actually fatals have been renamed to FATAL_.
87
- *
88
- * Message text is defined by kmcmplib and passed through a callback.
89
- */
90
- export class KmnCompilerMessages {
91
- static INFO_None = SevInfo | 0x000;
146
+ static Error_FileNotFound = (o) => m(this.ERROR_FileNotFound, `File ${def(o.filename)} was not found`, `The file was not found on the disk. Verify that you have the correct path
147
+ to the file.`);
148
+ // static INFO_None = SevInfo | 0x000;
92
149
  static INFO_EndOfFile = SevInfo | 0x001;
150
+ static Info_EndOfFile = () => m(this.INFO_EndOfFile, `(no error - reserved code)`);
93
151
  static FATAL_BadCallParams = SevFatal | 0x002;
152
+ static Fatal_BadCallParams = () => m(this.FATAL_BadCallParams, `CompileKeyboardFile was called with bad parameters`);
94
153
  static FATAL_CannotAllocateMemory = SevFatal | 0x004;
95
- static FATAL_InfileNotExist = SevFatal | 0x005;
96
- static FATAL_CannotCreateOutfile = SevFatal | 0x006;
154
+ static Fatal_CannotAllocateMemory = () => m(this.FATAL_CannotAllocateMemory, `Out of memory`);
155
+ static ERROR_InfileNotExist = SevError | 0x005; // #10678: reduced from fatal to error in 17.0
156
+ static Error_InfileNotExist = () => m(this.ERROR_InfileNotExist, `Cannot find the input file`);
157
+ // static ERROR_CannotCreateOutfile = SevError | 0x006; // #10678: reduced from fatal to error in 17.0, but unused
158
+ // static Error_CannotCreateOutfile = () => m(this.ERROR_CannotCreateOutfile, `Cannot open output file for writing`); unused
97
159
  static FATAL_UnableToWriteFully = SevFatal | 0x007;
98
- static FATAL_CannotReadInfile = SevFatal | 0x008;
160
+ static Fatal_UnableToWriteFully = () => m(this.FATAL_UnableToWriteFully, `Unable to write the file completely`);
161
+ static ERROR_CannotReadInfile = SevError | 0x008; // #10678: reduced from fatal to error in 17.0
162
+ static Error_CannotReadInfile = () => m(this.ERROR_CannotReadInfile, `Cannot read the input file`);
99
163
  static FATAL_SomewhereIGotItWrong = SevFatal | 0x009;
164
+ static Fatal_SomewhereIGotItWrong = () => m(this.FATAL_SomewhereIGotItWrong, `Internal error: contact Keyman`);
100
165
  static ERROR_InvalidToken = SevError | 0x00A;
166
+ static Error_InvalidToken = () => m(this.ERROR_InvalidToken, `Invalid token found`);
167
+ // kmcmplib: static Error_InvalidBegin = () => m(this.ERROR_InvalidBegin, `Invalid 'begin' command`);
101
168
  static ERROR_InvalidBegin = SevError | 0x00B;
169
+ static Error_InvalidBegin = () => mw(this.ERROR_InvalidBegin, `A "begin unicode" statement is required to compile a KeymanWeb keyboard`);
102
170
  static ERROR_InvalidName = SevError | 0x00C;
171
+ static Error_InvalidName = () => m(this.ERROR_InvalidName, `Invalid 'name' command`);
103
172
  static ERROR_InvalidVersion = SevError | 0x00D;
173
+ static Error_InvalidVersion = () => m(this.ERROR_InvalidVersion, `Invalid 'version' command`);
104
174
  static ERROR_InvalidLanguageLine = SevError | 0x00E;
175
+ static Error_InvalidLanguageLine = () => m(this.ERROR_InvalidLanguageLine, `Invalid 'language' command`);
105
176
  static ERROR_LayoutButNoLanguage = SevError | 0x00F;
177
+ static Error_LayoutButNoLanguage = () => m(this.ERROR_LayoutButNoLanguage, `Layout command found but no language command`);
106
178
  static ERROR_InvalidLayoutLine = SevError | 0x010;
179
+ static Error_InvalidLayoutLine = () => m(this.ERROR_InvalidLayoutLine, `Invalid 'layout' command`);
107
180
  static ERROR_NoVersionLine = SevError | 0x011;
181
+ static Error_NoVersionLine = () => m(this.ERROR_NoVersionLine, `No version line found for file`);
108
182
  static ERROR_InvalidGroupLine = SevError | 0x012;
183
+ static Error_InvalidGroupLine = () => m(this.ERROR_InvalidGroupLine, `Invalid 'group' command`);
109
184
  static ERROR_InvalidStoreLine = SevError | 0x013;
185
+ static Error_InvalidStoreLine = () => m(this.ERROR_InvalidStoreLine, `Invalid 'store' command`);
110
186
  static ERROR_InvalidCodeInKeyPartOfRule = SevError | 0x014;
187
+ static Error_InvalidCodeInKeyPartOfRule = () => m(this.ERROR_InvalidCodeInKeyPartOfRule, `Invalid command or code found in key part of rule`);
111
188
  static ERROR_InvalidDeadkey = SevError | 0x015;
189
+ static Error_InvalidDeadkey = () => m(this.ERROR_InvalidDeadkey, `Invalid 'deadkey' or 'dk' command`);
112
190
  static ERROR_InvalidValue = SevError | 0x016;
191
+ static Error_InvalidValue = () => m(this.ERROR_InvalidValue, `Invalid value in extended string`);
113
192
  static ERROR_ZeroLengthString = SevError | 0x017;
193
+ static Error_ZeroLengthString = () => m(this.ERROR_ZeroLengthString, `A string of zero characters was found`);
114
194
  static ERROR_TooManyIndexToKeyRefs = SevError | 0x018;
195
+ static Error_TooManyIndexToKeyRefs = () => m(this.ERROR_TooManyIndexToKeyRefs, `Too many index commands refering to key string`);
115
196
  static ERROR_UnterminatedString = SevError | 0x019;
197
+ static Error_UnterminatedString = () => m(this.ERROR_UnterminatedString, `Unterminated string in line`);
116
198
  static ERROR_StringInVirtualKeySection = SevError | 0x01A;
199
+ static Error_StringInVirtualKeySection = () => m(this.ERROR_StringInVirtualKeySection, `extend string illegal in virtual key section`);
117
200
  static ERROR_AnyInVirtualKeySection = SevError | 0x01B;
201
+ static Error_AnyInVirtualKeySection = () => m(this.ERROR_AnyInVirtualKeySection, `'any' command is illegal in virtual key section`);
118
202
  static ERROR_InvalidAny = SevError | 0x01C;
203
+ static Error_InvalidAny = () => m(this.ERROR_InvalidAny, `Invalid 'any' command`);
119
204
  static ERROR_StoreDoesNotExist = SevError | 0x01D;
205
+ static Error_StoreDoesNotExist = () => m(this.ERROR_StoreDoesNotExist, `Store referenced does not exist`);
120
206
  static ERROR_BeepInVirtualKeySection = SevError | 0x01E;
207
+ static Error_BeepInVirtualKeySection = () => m(this.ERROR_BeepInVirtualKeySection, `'beep' command is illegal in virtual key section`);
121
208
  static ERROR_IndexInVirtualKeySection = SevError | 0x01F;
209
+ static Error_IndexInVirtualKeySection = () => m(this.ERROR_IndexInVirtualKeySection, `'index' command is illegal in virtual key section`);
122
210
  static ERROR_InvalidIndex = SevError | 0x020;
211
+ static Error_InvalidIndex = () => m(this.ERROR_InvalidIndex, `Invalid 'index' command`);
123
212
  static ERROR_OutsInVirtualKeySection = SevError | 0x021;
213
+ static Error_OutsInVirtualKeySection = () => m(this.ERROR_OutsInVirtualKeySection, `'outs' command is illegal in virtual key section`);
124
214
  static ERROR_InvalidOuts = SevError | 0x022;
215
+ static Error_InvalidOuts = () => m(this.ERROR_InvalidOuts, `Invalid 'outs' command`);
125
216
  static ERROR_ContextInVirtualKeySection = SevError | 0x024;
217
+ static Error_ContextInVirtualKeySection = () => m(this.ERROR_ContextInVirtualKeySection, `'context' command is illegal in virtual key section`);
126
218
  static ERROR_InvalidUse = SevError | 0x025;
219
+ static Error_InvalidUse = () => m(this.ERROR_InvalidUse, `Invalid 'use' command`);
127
220
  static ERROR_GroupDoesNotExist = SevError | 0x026;
221
+ static Error_GroupDoesNotExist = () => m(this.ERROR_GroupDoesNotExist, `Group does not exist`);
128
222
  static ERROR_VirtualKeyNotAllowedHere = SevError | 0x027;
223
+ static Error_VirtualKeyNotAllowedHere = () => m(this.ERROR_VirtualKeyNotAllowedHere, `Virtual key is not allowed here`);
129
224
  static ERROR_InvalidSwitch = SevError | 0x028;
225
+ static Error_InvalidSwitch = () => m(this.ERROR_InvalidSwitch, `Invalid 'switch' command`);
130
226
  static ERROR_NoTokensFound = SevError | 0x029;
227
+ static Error_NoTokensFound = () => m(this.ERROR_NoTokensFound, `No tokens found in line`);
131
228
  static ERROR_InvalidLineContinuation = SevError | 0x02A;
229
+ static Error_InvalidLineContinuation = () => m(this.ERROR_InvalidLineContinuation, `Invalid line continuation`);
132
230
  static ERROR_LineTooLong = SevError | 0x02B;
231
+ static Error_LineTooLong = () => m(this.ERROR_LineTooLong, `Line too long`);
133
232
  static ERROR_InvalidCopyright = SevError | 0x02C;
233
+ static Error_InvalidCopyright = () => m(this.ERROR_InvalidCopyright, `Invalid 'copyright' command`);
134
234
  static ERROR_CodeInvalidInThisSection = SevError | 0x02D;
235
+ static Error_CodeInvalidInThisSection = () => m(this.ERROR_CodeInvalidInThisSection, `This line is invalid in this section of the file`);
135
236
  static ERROR_InvalidMessage = SevError | 0x02E;
237
+ static Error_InvalidMessage = () => m(this.ERROR_InvalidMessage, `Invalid 'message' command`);
136
238
  static ERROR_InvalidLanguageName = SevError | 0x02F;
239
+ static Error_InvalidLanguageName = () => m(this.ERROR_InvalidLanguageName, `Invalid 'languagename' command`);
137
240
  static ERROR_InvalidBitmapLine = SevError | 0x030;
241
+ static Error_InvalidBitmapLine = () => m(this.ERROR_InvalidBitmapLine, `Invalid 'bitmaps' command`);
138
242
  static ERROR_CannotReadBitmapFile = SevError | 0x031;
243
+ static Error_CannotReadBitmapFile = () => m(this.ERROR_CannotReadBitmapFile, `Cannot open the bitmap or icon file for reading`);
139
244
  static ERROR_IndexDoesNotPointToAny = SevError | 0x032;
245
+ static Error_IndexDoesNotPointToAny = () => m(this.ERROR_IndexDoesNotPointToAny, `An index() in the output does not have a corresponding any() statement`);
140
246
  static ERROR_ReservedCharacter = SevError | 0x033;
247
+ static Error_ReservedCharacter = () => m(this.ERROR_ReservedCharacter, `A reserved character was found`);
141
248
  static ERROR_InvalidCharacter = SevError | 0x034;
249
+ static Error_InvalidCharacter = () => m(this.ERROR_InvalidCharacter, `A character was found that is outside the valid Unicode range (U+0000 - U+10FFFF)`);
142
250
  static ERROR_InvalidCall = SevError | 0x035;
251
+ static Error_InvalidCall = () => m(this.ERROR_InvalidCall, `The 'call' command is invalid`);
143
252
  static ERROR_CallInVirtualKeySection = SevError | 0x036;
253
+ static Error_CallInVirtualKeySection = () => m(this.ERROR_CallInVirtualKeySection, `'call' command is illegal in virtual key section`);
144
254
  static ERROR_CodeInvalidInKeyStore = SevError | 0x037;
255
+ static Error_CodeInvalidInKeyStore = () => m(this.ERROR_CodeInvalidInKeyStore, `The command is invalid inside a store that is used in a key part of the rule`);
145
256
  static ERROR_CannotLoadIncludeFile = SevError | 0x038;
257
+ static Error_CannotLoadIncludeFile = () => m(this.ERROR_CannotLoadIncludeFile, `Cannot load the included file: it is either invalid or does not exist`);
146
258
  static ERROR_60FeatureOnly_EthnologueCode = SevError | 0x039;
259
+ static Error_60FeatureOnly_EthnologueCode = () => m(this.ERROR_60FeatureOnly_EthnologueCode, `EthnologueCode system store requires VERSION 6.0 or higher`);
147
260
  static ERROR_60FeatureOnly_MnemonicLayout = SevError | 0x03A;
261
+ static Error_60FeatureOnly_MnemonicLayout = () => m(this.ERROR_60FeatureOnly_MnemonicLayout, `MnemonicLayout functionality requires VERSION 6.0 or higher`);
148
262
  static ERROR_60FeatureOnly_OldCharPosMatching = SevError | 0x03B;
263
+ static Error_60FeatureOnly_OldCharPosMatching = () => m(this.ERROR_60FeatureOnly_OldCharPosMatching, `OldCharPosMatching system store requires VERSION 6.0 or higher`);
149
264
  static ERROR_60FeatureOnly_NamedCodes = SevError | 0x03C;
265
+ static Error_60FeatureOnly_NamedCodes = () => m(this.ERROR_60FeatureOnly_NamedCodes, `Named character constants requires VERSION 6.0 or higher`);
150
266
  static ERROR_60FeatureOnly_Contextn = SevError | 0x03D;
267
+ static Error_60FeatureOnly_Contextn = () => m(this.ERROR_60FeatureOnly_Contextn, `Context(n) requires VERSION 6.0 or higher`);
151
268
  static ERROR_501FeatureOnly_Call = SevError | 0x03E;
269
+ static Error_501FeatureOnly_Call = () => m(this.ERROR_501FeatureOnly_Call, `Call() requires VERSION 5.01 or higher`);
152
270
  static ERROR_InvalidNamedCode = SevError | 0x03F;
271
+ static Error_InvalidNamedCode = () => m(this.ERROR_InvalidNamedCode, `Invalid named code constant`);
153
272
  static ERROR_InvalidSystemStore = SevError | 0x040;
273
+ static Error_InvalidSystemStore = () => m(this.ERROR_InvalidSystemStore, `Invalid system store name found`);
154
274
  static ERROR_60FeatureOnly_VirtualCharKey = SevError | 0x044;
275
+ static Error_60FeatureOnly_VirtualCharKey = () => m(this.ERROR_60FeatureOnly_VirtualCharKey, `Virtual character keys require VERSION 6.0 or higher`);
155
276
  static ERROR_VersionAlreadyIncluded = SevError | 0x045;
277
+ static Error_VersionAlreadyIncluded = () => m(this.ERROR_VersionAlreadyIncluded, `Only one VERSION or store(version) line allowed in a source file.`);
156
278
  static ERROR_70FeatureOnly = SevError | 0x046;
279
+ static Error_70FeatureOnly = () => m(this.ERROR_70FeatureOnly, `This feature requires store(version) '7.0' or higher`);
157
280
  static ERROR_80FeatureOnly = SevError | 0x047;
281
+ static Error_80FeatureOnly = () => m(this.ERROR_80FeatureOnly, `This feature requires store(version) '8.0' or higher`);
158
282
  static ERROR_InvalidInVirtualKeySection = SevError | 0x048;
283
+ static Error_InvalidInVirtualKeySection = () => m(this.ERROR_InvalidInVirtualKeySection, `This statement is not valid in a virtual key section`);
159
284
  static ERROR_InvalidIf = SevError | 0x049;
285
+ static Error_InvalidIf = () => m(this.ERROR_InvalidIf, `The if() statement is not valid`);
160
286
  static ERROR_InvalidReset = SevError | 0x04A;
287
+ static Error_InvalidReset = () => m(this.ERROR_InvalidReset, `The reset() statement is not valid`);
161
288
  static ERROR_InvalidSet = SevError | 0x04B;
289
+ static Error_InvalidSet = () => m(this.ERROR_InvalidSet, `The set() statement is not valid`);
162
290
  static ERROR_InvalidSave = SevError | 0x04C;
291
+ static Error_InvalidSave = () => m(this.ERROR_InvalidSave, `The save() statement is not valid`);
163
292
  static ERROR_InvalidEthnologueCode = SevError | 0x04D;
293
+ static Error_InvalidEthnologueCode = () => m(this.ERROR_InvalidEthnologueCode, `Invalid ethnologuecode format`);
164
294
  static FATAL_CannotCreateTempfile = SevFatal | 0x04E;
295
+ static Fatal_CannotCreateTempfile = () => m(this.FATAL_CannotCreateTempfile, `Cannot create temp file`);
165
296
  static ERROR_90FeatureOnly_IfSystemStores = SevError | 0x04F;
297
+ static Error_90FeatureOnly_IfSystemStores = () => m(this.ERROR_90FeatureOnly_IfSystemStores, `if(store) requires store(version) '9.0' or higher`);
166
298
  static ERROR_IfSystemStore_NotFound = SevError | 0x050;
299
+ static Error_IfSystemStore_NotFound = () => m(this.ERROR_IfSystemStore_NotFound, `System store in if() not found`);
167
300
  static ERROR_90FeatureOnly_SetSystemStores = SevError | 0x051;
301
+ static Error_90FeatureOnly_SetSystemStores = () => m(this.ERROR_90FeatureOnly_SetSystemStores, `set(store) requires store(version) '9.0' or higher`);
168
302
  static ERROR_SetSystemStore_NotFound = SevError | 0x052;
303
+ static Error_SetSystemStore_NotFound = () => m(this.ERROR_SetSystemStore_NotFound, `System store in set() not found`);
169
304
  static ERROR_90FeatureOnlyVirtualKeyDictionary = SevError | 0x053;
305
+ static Error_90FeatureOnlyVirtualKeyDictionary = () => m(this.ERROR_90FeatureOnlyVirtualKeyDictionary, `Custom virtual key names require store(version) '9.0'`);
170
306
  static ERROR_NotSupportedInKeymanWebContext = SevError | 0x054;
307
+ static Error_NotSupportedInKeymanWebContext = (o) => mw(this.ERROR_NotSupportedInKeymanWebContext, `Statement '${def(o.code)}' is not currently supported in context for web and touch targets`, o);
171
308
  static ERROR_NotSupportedInKeymanWebOutput = SevError | 0x055;
309
+ static Error_NotSupportedInKeymanWebOutput = (o) => mw(this.ERROR_NotSupportedInKeymanWebOutput, `Statement '${def(o.code)}' is not currently supported in output for web and touch targets`, o);
172
310
  static ERROR_NotSupportedInKeymanWebStore = SevError | 0x056;
311
+ static Error_NotSupportedInKeymanWebStore = (o) => mw(this.ERROR_NotSupportedInKeymanWebStore, `'${def(o.code)}' is not currently supported in store '${def(o.store)}' when used by any or index for web and touch targets`);
173
312
  static ERROR_VirtualCharacterKeysNotSupportedInKeymanWeb = SevError | 0x057;
313
+ static Error_VirtualCharacterKeysNotSupportedInKeymanWeb = (o) => mw(this.ERROR_VirtualCharacterKeysNotSupportedInKeymanWeb, `Virtual character keys not currently supported in KeymanWeb`, o);
174
314
  static ERROR_VirtualKeysNotValidForMnemonicLayouts = SevError | 0x058;
315
+ static Error_VirtualKeysNotValidForMnemonicLayouts = (o) => mw(this.ERROR_VirtualKeysNotValidForMnemonicLayouts, `Virtual keys are not valid for mnemonic layouts`, o);
175
316
  static ERROR_InvalidTouchLayoutFile = SevError | 0x059;
317
+ static Error_InvalidTouchLayoutFile = (o) => mw(this.ERROR_InvalidTouchLayoutFile, `Touch layout file ${def(o.filename)} is not valid`);
176
318
  static ERROR_TouchLayoutInvalidIdentifier = SevError | 0x05A;
319
+ static Error_TouchLayoutInvalidIdentifier = (o) => mw(this.ERROR_TouchLayoutInvalidIdentifier, `Key "${def(o.keyId)}" on "${def(o.platformName)}", layer "${def(o.layerId)}" has an invalid identifier.`);
177
320
  static ERROR_InvalidKeyCode = SevError | 0x05B;
321
+ static Error_InvalidKeyCode = (o) => mw(this.ERROR_InvalidKeyCode, `Invalid key identifier "${def(o.keyId)}"`);
178
322
  static ERROR_90FeatureOnlyLayoutFile = SevError | 0x05C;
323
+ static Error_90FeatureOnlyLayoutFile = () => m(this.ERROR_90FeatureOnlyLayoutFile, `Touch layout file reference requires store(version) '9.0'or higher`);
179
324
  static ERROR_90FeatureOnlyKeyboardVersion = SevError | 0x05D;
325
+ static Error_90FeatureOnlyKeyboardVersion = () => m(this.ERROR_90FeatureOnlyKeyboardVersion, `KeyboardVersion system store requires store(version) '9.0'or higher`);
180
326
  static ERROR_KeyboardVersionFormatInvalid = SevError | 0x05E;
327
+ static Error_KeyboardVersionFormatInvalid = () => m(this.ERROR_KeyboardVersionFormatInvalid, `KeyboardVersion format is invalid, expecting dot-separated integers`);
181
328
  static ERROR_ContextExHasInvalidOffset = SevError | 0x05F;
329
+ static Error_ContextExHasInvalidOffset = () => m(this.ERROR_ContextExHasInvalidOffset, `context() statement has offset out of range`);
182
330
  static ERROR_90FeatureOnlyEmbedCSS = SevError | 0x060;
331
+ static Error_90FeatureOnlyEmbedCSS = () => m(this.ERROR_90FeatureOnlyEmbedCSS, `Embedding CSS requires store(version) '9.0'or higher`);
183
332
  static ERROR_90FeatureOnlyTargets = SevError | 0x061;
333
+ static Error_90FeatureOnlyTargets = () => m(this.ERROR_90FeatureOnlyTargets, `TARGETS system store requires store(version) '9.0'or higher`);
184
334
  static ERROR_ContextAndIndexInvalidInMatchNomatch = SevError | 0x062;
335
+ static Error_ContextAndIndexInvalidInMatchNomatch = () => m(this.ERROR_ContextAndIndexInvalidInMatchNomatch, `context and index statements cannot be used in a match or nomatch statement`);
185
336
  static ERROR_140FeatureOnlyContextAndNotAnyWeb = SevError | 0x063;
337
+ static Error_140FeatureOnlyContextAndNotAnyWeb = () => m(this.ERROR_140FeatureOnlyContextAndNotAnyWeb, `For web and touch platforms, context() statement referring to notany() requires store(version) '14.0'or higher`);
186
338
  static ERROR_ExpansionMustFollowCharacterOrVKey = SevError | 0x064;
339
+ static Error_ExpansionMustFollowCharacterOrVKey = () => m(this.ERROR_ExpansionMustFollowCharacterOrVKey, `An expansion must follow a character or a virtual key`);
187
340
  static ERROR_VKeyExpansionMustBeFollowedByVKey = SevError | 0x065;
341
+ static Error_VKeyExpansionMustBeFollowedByVKey = () => m(this.ERROR_VKeyExpansionMustBeFollowedByVKey, `A virtual key expansion must be terminated by a virtual key`);
188
342
  static ERROR_CharacterExpansionMustBeFollowedByCharacter = SevError | 0x066;
343
+ static Error_CharacterExpansionMustBeFollowedByCharacter = () => m(this.ERROR_CharacterExpansionMustBeFollowedByCharacter, `A character expansion must be terminated by a character key`);
189
344
  static ERROR_VKeyExpansionMustUseConsistentShift = SevError | 0x067;
345
+ static Error_VKeyExpansionMustUseConsistentShift = () => m(this.ERROR_VKeyExpansionMustUseConsistentShift, `A virtual key expansion must use the same shift state for both terminators`);
190
346
  static ERROR_ExpansionMustBePositive = SevError | 0x068;
347
+ static Error_ExpansionMustBePositive = () => m(this.ERROR_ExpansionMustBePositive, `An expansion must have positive difference (i.e. A-Z, not Z-A)`);
191
348
  static ERROR_CasedKeysMustContainOnlyVirtualKeys = SevError | 0x069;
349
+ static Error_CasedKeysMustContainOnlyVirtualKeys = () => m(this.ERROR_CasedKeysMustContainOnlyVirtualKeys, `The &CasedKeys system store must contain only virtual keys or characters found on a US English keyboard`);
192
350
  static ERROR_CasedKeysMustNotIncludeShiftStates = SevError | 0x06A;
351
+ static Error_CasedKeysMustNotIncludeShiftStates = () => m(this.ERROR_CasedKeysMustNotIncludeShiftStates, `The &CasedKeys system store must not include shift states`);
193
352
  static ERROR_CasedKeysNotSupportedWithMnemonicLayout = SevError | 0x06B;
353
+ static Error_CasedKeysNotSupportedWithMnemonicLayout = () => m(this.ERROR_CasedKeysNotSupportedWithMnemonicLayout, `The &CasedKeys system store is not supported with mnemonic layouts`);
194
354
  static ERROR_CannotUseReadWriteGroupFromReadonlyGroup = SevError | 0x06C;
355
+ static Error_CannotUseReadWriteGroupFromReadonlyGroup = () => m(this.ERROR_CannotUseReadWriteGroupFromReadonlyGroup, `Group used from a readonly group must also be readonly`);
195
356
  static ERROR_StatementNotPermittedInReadonlyGroup = SevError | 0x06D;
357
+ static Error_StatementNotPermittedInReadonlyGroup = () => m(this.ERROR_StatementNotPermittedInReadonlyGroup, `Statement is not permitted in output of readonly group`);
196
358
  static ERROR_OutputInReadonlyGroup = SevError | 0x06E;
359
+ static Error_OutputInReadonlyGroup = () => m(this.ERROR_OutputInReadonlyGroup, `Output is not permitted in a readonly group`);
197
360
  static ERROR_NewContextGroupMustBeReadonly = SevError | 0x06F;
361
+ static Error_NewContextGroupMustBeReadonly = () => m(this.ERROR_NewContextGroupMustBeReadonly, `Group used in begin newContext must be readonly`);
198
362
  static ERROR_PostKeystrokeGroupMustBeReadonly = SevError | 0x070;
363
+ static Error_PostKeystrokeGroupMustBeReadonly = () => m(this.ERROR_PostKeystrokeGroupMustBeReadonly, `Group used in begin postKeystroke must be readonly`);
199
364
  static ERROR_DuplicateGroup = SevError | 0x071;
365
+ static Error_DuplicateGroup = () => m(this.ERROR_DuplicateGroup, `A group with this name has already been defined.`);
200
366
  static ERROR_DuplicateStore = SevError | 0x072;
367
+ static Error_DuplicateStore = () => m(this.ERROR_DuplicateStore, `A store with this name has already been defined.`);
201
368
  static ERROR_RepeatedBegin = SevError | 0x073;
369
+ static Error_RepeatedBegin = () => m(this.ERROR_RepeatedBegin, `Begin has already been set`);
202
370
  static ERROR_VirtualKeyInContext = SevError | 0x074;
371
+ static Error_VirtualKeyInContext = () => m(this.ERROR_VirtualKeyInContext, `Virtual keys are not permitted in context`);
203
372
  static WARN_TooManyWarnings = SevWarn | 0x080;
373
+ static Warn_TooManyWarnings = () => m(this.WARN_TooManyWarnings, `Too many warnings or errors`);
204
374
  static WARN_OldVersion = SevWarn | 0x081;
375
+ static Warn_OldVersion = () => m(this.WARN_OldVersion, `The keyboard file is an old version`);
205
376
  static WARN_BitmapNotUsed = SevWarn | 0x082;
377
+ static Warn_BitmapNotUsed = () => m(this.WARN_BitmapNotUsed, `The 'bitmaps' statement is obsolete and only the first bitmap referred to will be used, you should use 'bitmap'.`);
206
378
  static WARN_CustomLanguagesNotSupported = SevWarn | 0x083;
379
+ static Warn_CustomLanguagesNotSupported = () => m(this.WARN_CustomLanguagesNotSupported, `Languages over 0x1FF, 0x1F are not supported correctly by Windows. You should use no LANGUAGE line instead.`);
207
380
  static WARN_KeyBadLength = SevWarn | 0x084;
381
+ static Warn_KeyBadLength = () => m(this.WARN_KeyBadLength, `There are too many characters in the keystroke part of the rule.`);
208
382
  static WARN_IndexStoreShort = SevWarn | 0x085;
383
+ static Warn_IndexStoreShort = () => m(this.WARN_IndexStoreShort, `The store referenced in index() is shorter than the store referenced in any()`);
209
384
  static WARN_UnicodeInANSIGroup = SevWarn | 0x086;
385
+ static Warn_UnicodeInANSIGroup = () => m(this.WARN_UnicodeInANSIGroup, `A Unicode character was found in an ANSI group`);
210
386
  static WARN_ANSIInUnicodeGroup = SevWarn | 0x087;
387
+ static Warn_ANSIInUnicodeGroup = () => m(this.WARN_ANSIInUnicodeGroup, `An ANSI character was found in a Unicode group`);
211
388
  static WARN_UnicodeSurrogateUsed = SevWarn | 0x088;
389
+ static Warn_UnicodeSurrogateUsed = () => m(this.WARN_UnicodeSurrogateUsed, `A Unicode surrogate character was found. You should use Unicode scalar values to represent values > U+FFFF`);
212
390
  static WARN_ReservedCharacter = SevWarn | 0x089;
391
+ static Warn_ReservedCharacter = () => m(this.WARN_ReservedCharacter, `A Unicode character was found that should not be used`);
213
392
  // Note: INFO_Info is called CWARN_Info in kmn_compiler_errors.h, but should have an "info" severity
214
393
  static INFO_Info = SevInfo | 0x08A;
394
+ static Info_Info = () => m(this.INFO_Info, `Information`);
215
395
  static WARN_VirtualKeyWithMnemonicLayout = SevWarn | 0x08B;
396
+ static Warn_VirtualKeyWithMnemonicLayout = () => m(this.WARN_VirtualKeyWithMnemonicLayout, `Virtual key used instead of virtual character key with a mnemonic layout`);
216
397
  static WARN_VirtualCharKeyWithPositionalLayout = SevWarn | 0x08C;
398
+ static Warn_VirtualCharKeyWithPositionalLayout = () => m(this.WARN_VirtualCharKeyWithPositionalLayout, `Virtual character key used with a positional layout instead of mnemonic layout`);
217
399
  static WARN_StoreAlreadyUsedAsOptionOrCall = SevWarn | 0x08D;
400
+ static Warn_StoreAlreadyUsedAsOptionOrCall = () => m(this.WARN_StoreAlreadyUsedAsOptionOrCall, `Store already used as an option or in a call statement and should not be used as a normal store`);
218
401
  static WARN_StoreAlreadyUsedAsStoreOrCall = SevWarn | 0x08E;
402
+ static Warn_StoreAlreadyUsedAsStoreOrCall = () => m(this.WARN_StoreAlreadyUsedAsStoreOrCall, `Store already used as a normal store or in a call statement and should not be used as an option`);
219
403
  static WARN_StoreAlreadyUsedAsStoreOrOption = SevWarn | 0x08F;
404
+ static Warn_StoreAlreadyUsedAsStoreOrOption = () => m(this.WARN_StoreAlreadyUsedAsStoreOrOption, `Store already used as a normal store or as an option and should not be used in a call statement`);
220
405
  static WARN_PunctuationInEthnologueCode = SevWarn | 0x090;
406
+ static Warn_PunctuationInEthnologueCode = () => m(this.WARN_PunctuationInEthnologueCode, `Punctuation should not be used to separate Ethnologue codes; instead use spaces`);
221
407
  static WARN_TouchLayoutMissingLayer = SevWarn | 0x091;
408
+ static Warn_TouchLayoutMissingLayer = (o) => mw(this.WARN_TouchLayoutMissingLayer, `Key "${def(o.keyId)}" on platform "${def(o.platformName)}", layer "${def(o.layerId)}", references a missing layer "${def(o.nextLayer)}"`);
222
409
  static WARN_TouchLayoutCustomKeyNotDefined = SevWarn | 0x092;
410
+ static Warn_TouchLayoutCustomKeyNotDefined = (o) => mw(this.WARN_TouchLayoutCustomKeyNotDefined, `Key "${def(o.keyId)}" on platform "${def(o.platformName)}", layer "${def(o.layerId)}", is a custom key but has no corresponding rule in the source.`);
223
411
  static WARN_TouchLayoutMissingRequiredKeys = SevWarn | 0x093;
412
+ static Warn_TouchLayoutMissingRequiredKeys = (o) => mw(this.WARN_TouchLayoutMissingRequiredKeys, `Layer "${def(o.layerId)}" on platform "${def(o.platformName)}" is missing the required key(s) '${def(o.missingKeys)}'.`);
224
413
  static WARN_HelpFileMissing = SevWarn | 0x094;
414
+ static Warn_HelpFileMissing = (o) => mw(this.WARN_HelpFileMissing, `File ${def(o.helpFilename)} could not be loaded: ${(o.e ?? '').toString()}`, o);
225
415
  static WARN_EmbedJsFileMissing = SevWarn | 0x095;
226
- static WARN_TouchLayoutFileMissing = SevWarn | 0x096;
227
- static WARN_VisualKeyboardFileMissing = SevWarn | 0x097;
416
+ static Warn_EmbedJsFileMissing = (o) => mw(this.WARN_EmbedJsFileMissing, `File ${def(o.jsFilename)} could not be loaded: ${(o.e ?? '').toString()}`, o);
417
+ // static WARN_TouchLayoutFileMissing = SevWarn | 0x096;
418
+ // static WARN_VisualKeyboardFileMissing = SevWarn | 0x097;
228
419
  static WARN_ExtendedShiftFlagsNotSupportedInKeymanWeb = SevWarn | 0x098;
420
+ static Warn_ExtendedShiftFlagsNotSupportedInKeymanWeb = (o) => mw(this.WARN_ExtendedShiftFlagsNotSupportedInKeymanWeb, `Extended shift flags ${def(o.flags)} are not supported in KeymanWeb`, o);
229
421
  static WARN_TouchLayoutUnidentifiedKey = SevWarn | 0x099;
422
+ static Warn_TouchLayoutUnidentifiedKey = (o) => mw(this.WARN_TouchLayoutUnidentifiedKey, `A key on layer "${def(o.layerId)}" has no identifier.`);
230
423
  static HINT_UnreachableKeyCode = SevHint | 0x09A;
231
- static WARN_CouldNotCopyJsonFile = SevWarn | 0x09B;
424
+ static Hint_UnreachableKeyCode = (o) => mw(this.HINT_UnreachableKeyCode, `The rule will never be matched for key ${def(o.key)} because its key code is never fired.`, o);
425
+ // static WARN_CouldNotCopyJsonFile = SevWarn | 0x09B;
232
426
  static WARN_PlatformNotInTargets = SevWarn | 0x09C;
427
+ static Warn_PlatformNotInTargets = () => m(this.WARN_PlatformNotInTargets, `The specified platform is not a target platform`);
233
428
  static WARN_HeaderStatementIsDeprecated = SevWarn | 0x09D;
429
+ static Warn_HeaderStatementIsDeprecated = () => m(this.WARN_HeaderStatementIsDeprecated, `Header statements are deprecated; use instead the equivalent system store`);
234
430
  static WARN_UseNotLastStatementInRule = SevWarn | 0x09E;
431
+ static Warn_UseNotLastStatementInRule = () => m(this.WARN_UseNotLastStatementInRule, `A rule with use() statements in the output should not have other content following the use() statements`);
235
432
  static WARN_TouchLayoutFontShouldBeSameForAllPlatforms = SevWarn | 0x09F;
236
- static WARN_InvalidJSONMetadataFile = SevWarn | 0x0A0;
237
- static WARN_JSONMetadataOSKFontShouldMatchTouchFont = SevWarn | 0x0A1;
433
+ static Warn_TouchLayoutFontShouldBeSameForAllPlatforms = () => mw(this.WARN_TouchLayoutFontShouldBeSameForAllPlatforms, `The touch layout font should be the same for all platforms.`);
434
+ // static WARN_InvalidJSONMetadataFile = SevWarn | 0x0A0;
435
+ // static WARN_JSONMetadataOSKFontShouldMatchTouchFont = SevWarn | 0x0A1;
238
436
  static WARN_KVKFileIsInSourceFormat = SevWarn | 0x0A2;
437
+ static Warn_KVKFileIsInSourceFormat = () => m(this.WARN_KVKFileIsInSourceFormat, `.kvk file should be binary but is an XML file`);
438
+ // kmcmplib: static Warn_DontMixChiralAndNonChiralModifiers = () => m(this.WARN_DontMixChiralAndNonChiralModifiers, `Don't mix the use of left/right modifiers with non-left/right modifiers in the same platform`);
239
439
  static WARN_DontMixChiralAndNonChiralModifiers = SevWarn | 0x0A3;
440
+ static Warn_DontMixChiralAndNonChiralModifiers = () => mw(this.WARN_DontMixChiralAndNonChiralModifiers, `This keyboard contains Ctrl,Alt and LCtrl,LAlt,RCtrl,RAlt sets of modifiers. Use only one or the other set for web target.`);
240
441
  static WARN_MixingLeftAndRightModifiers = SevWarn | 0x0A4;
442
+ static Warn_MixingLeftAndRightModifiers = () => m(this.WARN_MixingLeftAndRightModifiers, `Left and right modifiers should not both be used in the same rule`);
241
443
  static WARN_LanguageHeadersDeprecatedInKeyman10 = SevWarn | 0x0A5;
444
+ static Warn_LanguageHeadersDeprecatedInKeyman10 = () => m(this.WARN_LanguageHeadersDeprecatedInKeyman10, `This language header has been deprecated in Keyman 10. Instead, add language metadata in the package file`);
242
445
  static HINT_NonUnicodeFile = SevHint | 0x0A6;
243
- static WARN_TooManyErrorsOrWarnings = SevWarn | 0x0A7;
446
+ static Hint_NonUnicodeFile = () => m(this.HINT_NonUnicodeFile, `Keyman Developer has detected that the file has ANSI encoding. Consider converting this file to UTF-8`);
447
+ // static WARN_TooManyErrorsOrWarnings = SevWarn | 0x0A7;
244
448
  static WARN_HotkeyHasInvalidModifier = SevWarn | 0x0A8;
449
+ static Warn_HotkeyHasInvalidModifier = () => m(this.WARN_HotkeyHasInvalidModifier, `Hotkey has modifiers that are not supported. Use only SHIFT, CTRL and ALT`);
245
450
  static WARN_TouchLayoutSpecialLabelOnNormalKey = SevWarn | 0x0A9;
451
+ static Warn_TouchLayoutSpecialLabelOnNormalKey = (o) => mw(this.WARN_TouchLayoutSpecialLabelOnNormalKey, `Key "${def(o.keyId)}" on platform "${def(o.platformName)}", layer "${def(o.layerId)}" does not have ` +
452
+ `the key type "Special" or "Special (active)" but has the label "${def(o.label)}". This feature is only supported in Keyman 14 or later`);
246
453
  static WARN_OptionStoreNameInvalid = SevWarn | 0x0AA;
454
+ static Warn_OptionStoreNameInvalid = (o) => mw(this.WARN_OptionStoreNameInvalid, `The option store ${def(o.name)} should be named with characters in the range A-Z, a-z, 0-9 and _ only.`);
247
455
  static WARN_NulNotFirstStatementInContext = SevWarn | 0x0AB;
456
+ static Warn_NulNotFirstStatementInContext = () => m(this.WARN_NulNotFirstStatementInContext, `nul must be the first statement in the context`);
248
457
  static WARN_IfShouldBeAtStartOfContext = SevWarn | 0x0AC;
458
+ static Warn_IfShouldBeAtStartOfContext = () => m(this.WARN_IfShouldBeAtStartOfContext, `if, platform and baselayout should be at start of context (after nul, if present)`);
249
459
  static WARN_KeyShouldIncludeNCaps = SevWarn | 0x0AD;
460
+ static Warn_KeyShouldIncludeNCaps = () => m(this.WARN_KeyShouldIncludeNCaps, `Other rules which reference this key include CAPS or NCAPS modifiers, so this rule must include NCAPS modifier to avoid inconsistent matches`);
250
461
  static HINT_UnreachableRule = SevHint | 0x0AE;
462
+ static Hint_UnreachableRule = () => m(this.HINT_UnreachableRule, `This rule will never be matched as another rule takes precedence`);
251
463
  static WARN_VirtualKeyInOutput = SevWarn | 0x0AF;
464
+ static Warn_VirtualKeyInOutput = () => m(this.WARN_VirtualKeyInOutput, `Virtual keys are not supported in output`);
252
465
  static FATAL_BufferOverflow = SevFatal | 0x0C0;
466
+ static Fatal_BufferOverflow = () => m(this.FATAL_BufferOverflow, `The compiler memory buffer overflowed`);
253
467
  static FATAL_Break = SevFatal | 0x0C1;
468
+ static Fatal_Break = () => m(this.FATAL_Break, `Compiler interrupted by user`);
254
469
  }
255
470
  ;
471
+ /**
472
+ * @internal
473
+ * TODO: This class is here as a stopgap as we merged it with
474
+ * KmnCompilerMessages. It should be removed in v18.0.
475
+ */
476
+ export class CompilerMessages extends KmnCompilerMessages {
477
+ }
256
478
  export function mapErrorFromKmcmplib(line, code, msg) {
257
479
  const severity = LogLevelToSeverity[code & 61440 /* LogLevel.LEVEL_MASK */];
258
480
  const baseCode = code & 4095 /* LogLevel.CODE_MASK */;
@@ -264,5 +486,5 @@ export function mapErrorFromKmcmplib(line, code, msg) {
264
486
  return event;
265
487
  }
266
488
  ;
267
- //# debugId=33058ebc-c7fb-59ed-aa87-4aba9b54b603
489
+ //# debugId=e2a9d11c-b57d-5232-9f5e-567fd78fb207
268
490
  //# sourceMappingURL=kmn-compiler-messages.js.map