Debian Codegraph @

terps/tads/tads3/tcerrmsg.cpp

raw
1 #ifdef RCSID
2 static char RCSid[] =
3 "$Header$";
4 #endif
5
6 /*
7 * Copyright (c) 2000, 2002 Michael J. Roberts. All Rights Reserved.
8 *
9 * Please see the accompanying license file, LICENSE.TXT, for information
10 * on using and copying this software.
11 */
12 /*
13 Name
14 tcerrmsg.cpp - TADS 3 Compiler error message text
15 Function
16 Defines the error message strings for the TADS 3 compiler. The message
17 strings are all isolated in this module to allow for easy replacement
18 for translated versions.
19 Notes
20
21 Modified
22 05/13/00 MJRoberts - Creation
23 */
24
25 #include "tcerr.h"
26 #include "tcerrnum.h"
27
28 /* ------------------------------------------------------------------------ */
29 /*
30 * Error Messages - fixed English version; these can be replaced at
31 * run-time by messages loaded from an external file, but we compile in an
32 * English set as a fallback in case there's no message file.
33 *
34 * The messages must be sorted by message number, so that we can perform a
35 * binary search to look up a message by number.
36 */
37 const err_msg_t tc_messages_english[] =
38 {
39 { TCERR_LINE_MEM,
40 "out of memory for line source",
41 "Out of memory for line source. The source line may be too long, "
42 "or you may need to make more memory available to the compiler "
43 "by closing other applications." },
44
45 { TCERR_INV_PP_DIR,
46 "invalid preprocessor directive",
47 "\"%~.*s\" is not a valid preprocessor '#' directive." },
48
49 { TCERR_CANT_LOAD_CHARSET,
50 "unable to load #charset",
51 "Unable to load the character set specified in the #charset directive. "
52 "Check the spelling of the character set name, and make sure that "
53 "a character mapping file (with a name ending in \".TCM\") is "
54 "available. Refer to the compiler's installation notes for your "
55 "type of computer for details." },
56
57 { TCERR_UNEXPECTED_CHARSET,
58 "unexpected or invalid #charset",
59 "Unexpected or invalid #charset directive. This directive must "
60 "be at the very beginning of the file, and must specify a character "
61 "set name enclosed in double quotes." },
62
63 { TCERR_BAD_INC_SYNTAX,
64 "syntax error in #include",
65 "Invalid #include syntax - the filename must be enclosed with "
66 "'\"' or '< >' characters." },
67
68 { TCERR_INC_NOT_FOUND,
69 "cannot open include file \"%.*s\"",
70 "The compiler cannot access the #include file \"%.*s\". "
71 "Check the filename to ensure that it's spelled correctly, and check "
72 "the compiler's include path setting (command line \"-I\" options) "
73 "to ensure that the compiler is searching in the directory or folder "
74 "containing the file. If the file exists, make sure that it's not "
75 "being used by another application and that you have permission "
76 "to read the file." },
77
78 { TCERR_REDUNDANT_INCLUDE,
79 "file \"%.*s\" previously included; ignored",
80 "The #include file \"%.*s\" has already been included. "
81 "This redundant inclusion will be ignored." },
82
83 { TCERR_BAD_DEFINE_SYM,
84 "invalid symbol \"%~.*s\" for #define",
85 "Invalid symbol \"%~.*s\" for #define. A #define symbol must start "
86 "with an ASCII letter or underscore symbol '_', and must contain "
87 "only ASCII letters, digits, and underscores." },
88
89 { TCERR_MACRO_NO_RPAR,
90 "missing ')' in macro parameter list",
91 "The macro parameter list is missing a right parenthesis ')' at "
92 "the end of the list." },
93
94 { TCERR_BAD_MACRO_ARG_NAME,
95 "invalid macro parameter name \"%~.*s\"",
96 "Invalid macro parameter name \"%~.*s\". A macro parameter name must "
97 "start with an ASCII letter or underscore symbol '_', and must contain "
98 "only ASCII letters, digits, and underscores." },
99
100 { TCERR_MACRO_EXP_COMMA,
101 "expected ',' or ')' in macro parameter list (found \"%~.*s\")",
102 "Expected a comma ',' or right parenthesis ')' in the macro "
103 "parameter list, but found \"%~.*s\"." },
104
105 { TCERR_MACRO_REDEF,
106 "redefinition of macro \"%~.*s\"",
107 "Macro \"%~.*s\" has been previously defined; this new definition "
108 "replaces the previous definition." },
109
110 { TCERR_UNKNOWN_PRAGMA,
111 "unrecognized #pragma \"%~.*s\"; ignored",
112 "Unrecognized #pragma \"%~.*s\"; ignored. (The compiler ignores "
113 "#pragma directives that it doesn't understand, in case you're "
114 "using a #pragma meant for another compiler, but if you meant "
115 "the #pragma for this compiler, you need to correct a problem "
116 "with it.)" },
117
118 { TCERR_BAD_PRAGMA_SYNTAX,
119 "invalid syntax for #pragma",
120 "Invalid syntax for #pragma." },
121
122 { TCERR_PP_EXTRA,
123 "extra characters on line",
124 "Extra characters found after the end of the preprocessor directive. "
125 "Check the syntax and remove the extraneous characters at the "
126 "end of the line." },
127
128 { TCERR_IF_NESTING_OVERFLOW,
129 "#if nesting too deep",
130 "#if/#ifdef nesting is too deep - you have specified more "
131 "#if's within other #if's than the compiler allows. (The compiler "
132 "has an internal limit on this nesting; you must simplify the "
133 "nested #if structure of your source code.)" },
134
135 { TCERR_PP_ELSE_WITHOUT_IF,
136 "#else without #if",
137 "#else without a matching #if or #ifdef." },
138
139 { TCERR_PP_ENDIF_WITHOUT_IF,
140 "#endif without #if",
141 "#endif without a matching #if or #ifdef." },
142
143 { TCERR_PP_ELIF_WITHOUT_IF,
144 "#elif without #if",
145 "#elif without a matching #if." },
146
147 { TCERR_PP_INT_REQUIRED,
148 "integer value required in preprocessor constant expression",
149 "Incorrect value in preprocessor constant expression - an integer "
150 "value is required." },
151
152 { TCERR_PP_INCOMP_TYPES,
153 "incompatible types for comparison operator",
154 "Incompatible types for comparison in preprocessor constant "
155 "expression." },
156
157 { TCERR_PP_EXPR_EXTRA,
158 "extra characters at end of line",
159 "Extra characters found after end of preprocessor constant "
160 "expression. Check the syntax of the expression and remove any "
161 "extraneous characters at the end of the line." },
162
163 { TCERR_PP_DIV_ZERO,
164 "divide by zero in constant expression",
165 "Division by zero in preprocessor constant expression." },
166
167 { TCERR_PP_INVALID_VALUE,
168 "expected number, symbol, or string (found \"%~.*s\")",
169 "Expected a number, symbol, or single-quoted string in preprocessor "
170 "constant expression, but found \"%~.*s\"." },
171
172 { TCERR_PP_UNTERM_STRING,
173 "unterminated string in preprocessor constant expression",
174 "Unterminated string found in a preprocessor constant expression. "
175 "(A string in a preprocessor expression must be contained entirely "
176 "on a single line.)" },
177
178 { TCERR_PP_UNMATCHED_LPAR,
179 "unmatched '('",
180 "Unmatched left parenthesis '(' in preprocessor constant expression." },
181
182 { TCERR_PP_BAD_NOT_VAL,
183 "integer value required for '!' operator",
184 "Integer value is required for '!' operator in preprocessor "
185 "expression." },
186
187 { TCERR_PP_MACRO_ARG_RPAR_1LINE,
188 "missing ')' in argument list for macro \"%~.*s\"",
189 "Missing right parenthesis ')' in argument list in invocation of "
190 "macro \"%~.*s\". The entire argument list must be on a single "
191 "logical line for a line with a preprocessor directive (but you can "
192 "extend the logical line over several physical lines by ending each "
193 "line but the last with a backslash '\\')." },
194
195 { TCERR_PP_NO_MACRO_ARGS,
196 "missing argument list for macro \"%~.*s\"",
197 "An argument list must be specified in invocation of macro \"%~.*s\"." },
198
199 { TCERR_PP_FEW_MACRO_ARGS,
200 "not enough arguments for macro \"%~.*s\"",
201 "Not enough arguments are specified in invocation of macro \"%~.*s\"." },
202
203 { TCERR_PP_MACRO_ARG_RPAR,
204 "missing ')' in argument list for macro \"%~.*s\"",
205 "Missing right parenthesis ')' in argument list in "
206 "invocation of macro \"%~.*s\"." },
207
208 { TCERR_PP_MANY_MACRO_ARGS,
209 "too many arguments for macro \"%~.*s\"",
210 "Too many arguments found in invocation of macro \"%~.*s\". (The "
211 "macro was defined to take fewer arguments. Check the definition "
212 "of the macro for proper usage, and make sure that all of the "
213 "parentheses in the macro invocation are properly matched.)" },
214
215 { TCERR_PP_DEFINED_NO_SYM,
216 "symbol required for defined() (found \"%~.*s\")",
217 "Symbol required for defined() preprocessor operator "
218 "(found \"%~.*s\" instead.)" },
219
220 { TCERR_PP_DEFINED_RPAR,
221 "missing ')' in defined()",
222 "Missing right parenthesis ')' in defined() preprocess operator." },
223
224 { TCERR_SYMBOL_TRUNCATED,
225 "symbol \"%~.*s\" truncated to \"%~.*s\"",
226 "The symbol \"%~.*s\" is too long; it has been truncated to \"%~.*s\". "
227 "(The compiler limits the length of each symbol name; you must make "
228 "this symbol name shorter.)" },
229
230 { TCERR_TOO_MANY_MAC_PARMS,
231 "too many parameters for macro \"%~.*s\" (maximum %d)",
232 "Too many formal parameters are defined for macro "
233 "\"%~.*s\". (The compiler imposes a limit of %d parameters per macro.)" },
234
235 { TCERR_NO_STRBUF_MEM,
236 "out of memory for string buffer",
237 "Out of memory for string buffer. You may need to "
238 "close other applications to make more memory available for "
239 "the compiler." },
240
241 { TCERR_CANT_OPEN_SRC,
242 "unable to open source file \"%.*s\"",
243 "Unable to open source file \"%.*s\" - check that the filename "
244 "is spelled correctly, and check that the file exists and that you "
245 "have permission to open the file for reading." },
246
247 { TCERR_ERROR_DIRECTIVE,
248 "#error : %.*s",
249 "#error : %.*s" },
250
251 { TCERR_OUT_OF_MEM_MAC_EXP,
252 "out of memory for macro expansion",
253 "Out of memory for macro expansion. You may need to "
254 "close other applications to make more memory available for "
255 "the compiler." },
256
257 { TCERR_LINE_REQ_INT,
258 "integer value required for #line",
259 "An integer value is required for the line number in the #line "
260 "directive." },
261
262 { TCERR_LINE_FILE_REQ_STR,
263 "string value required for #line",
264 "A string value is required for the filename in the #line directive." },
265
266 { TCERR_IF_WITHOUT_ENDIF,
267 "#if without #endif (line %ld, file %.*s)",
268 "The #if directive at line %ld of file %.*s has no matching #endif "
269 "(a matching #endif is required in the same file as the #if)." },
270
271 { TCERR_UNSPLICE_NOT_CUR,
272 "unsplicing invalid line",
273 "Unsplicing invalid line." },
274
275 { TCERR_MULTI_UNSPLICE,
276 "too much unsplicing",
277 "Too much unsplicing." },
278
279 { TCERR_PP_ELIF_NOT_IN_SAME_FILE,
280 "#elif without #if",
281 "#elif without #if - an entire #if-#elif-#else-#endif sequence must "
282 "all be contained within a single file; this #elif appears to "
283 "correspond to a #if in the including file." },
284
285 { TCERR_PP_ELSE_NOT_IN_SAME_FILE,
286 "#else without #if",
287 "#else without #if - an entire #if-#elif-#else-#endif sequence must "
288 "all be contained within a single file; this #else appears to "
289 "correspond to a #if in the including file." },
290
291 { TCERR_PP_ENDIF_NOT_IN_SAME_FILE,
292 "#endif without #if",
293 "#endif without #if - an entire #if-#elif-#else-#endif sequence must "
294 "all be contained within a single file; this #endif appears to "
295 "correspond to a #if in the including file." },
296
297 { TCERR_REDEF_OP_DEFINED,
298 "cannot #define reserved preprocessor symbol \"defined\"",
299 "You cannot #define \"defined\" as a macro - this symbol is reserved "
300 "as a preprocessor keyword and cannot be defined as a macro name." },
301
302 { TCERR_POSSIBLE_UNTERM_STR,
303 "string appears unterminated (';' or '}' appears alone on line %ld)",
304 "This string appears unterminated, because ';' or '}' appears on a line "
305 "with no other non-blank characters (at line %ld) within the string. "
306 "Check the string for proper termination; if the string is "
307 "properly terminated and the ';' or '}' is meant to be part of the "
308 "string, move the ';' or '}' onto the next or previous line to group "
309 "it with at least one other non-whitespace character, so that it "
310 "doesn't confuse the compiler" },
311
312 { TCERR_SRCLINE_TOO_LONG,
313 "source line too long (exceeds maximum line length %ld bytes)",
314 "This source line is too long - it exceeds the internal compiler "
315 "limit of %ld bytes per source line. (The compiler's idea of the "
316 "length of the logical source line may be longer than the line appears "
317 "to be in the source file, because the compiler limit applies to the "
318 "line after expansion of macros, assembly of all parts of any string "
319 "that runs across several lines into a single line, and splicing of "
320 "any lines that end in backslash characters '\\'. You must reduce "
321 "the length of the logical source line; check in particular for any "
322 "quoted strings that run across several lines. " },
323
324 { TCERR_INVALID_CHAR,
325 "invalid character in input \"%~.*s\"",
326 "Invalid character in input: \"%~.*s\". This character is not valid "
327 "in any symbol name or as punctuation in source code; the character "
328 "will be ignored. Check for missing quotes around a string, a missing "
329 "ending quote for a string just before this point, or for "
330 "a quote mark embedded within an earlier string (if you want to use "
331 "a quote mark within a string, you must precede the quote mark with "
332 "a backslash '\\')." },
333
334 { TCERR_PP_QC_MISSING_COLON,
335 "missing colon ':' after conditional operator '?' in preprocessor "
336 "expression",
337 "The preprocessor constant conditional expression on this line is "
338 "missing the colon ':' part. A question-mark operator '?' must be "
339 "followed by the true-part, then a colon ':', then the false-part. "
340 "Check the expression to ensure proper placement of parentheses, "
341 "and check for other errors in the expression syntax. " },
342
343 { TCERR_PP_EXPR_NOT_CONST,
344 "preprocessor expression is not a constant value",
345 "The preprocessor expression given does not have a constant value. "
346 "A preprocessor expression (in a #if, #elif, or #line directive) "
347 "must use only numbers and strings, or #define symbols defined as "
348 "numbers or strings. Preprocessor expressions cannot include "
349 "variables, function calls, property references, or other values "
350 "that do not have a constant value during compilation." },
351
352 { TCERR_CANT_LOAD_DEFAULT_CHARSET,
353 "can't load mapping file for default character set \"%s\"",
354 "The compiler cannot open the mapping file for the default "
355 "character set, \"%s\". Make sure that a mapping file for this "
356 "character set (with the same name as the character set plus the "
357 "suffix \".TCM\") is properly installed on your system. Refer "
358 "to the compiler's installation notes for your type of "
359 "computer for details. You might need to re-install the compiler." },
360
361 { TCERR_MACRO_ELLIPSIS_REQ_RPAR,
362 "'...' in macro formal parameter list must be followed by ')' - "
363 "found \"%~.*s\"",
364 "An ellipsis '...' in a macro formal parameter list can only be "
365 "used with the last parameter to the macro, so it must be immediately "
366 "followed by a close parenthesis ')' - the compiler found \"%~.*s\" "
367 "instead. Check the macro definition syntax and insert the missing "
368 "parenthesis." },
369
370 { TCERR_PP_FOREACH_TOO_DEEP,
371 "#foreach/#ifempty/#ifnempty nesting too deep",
372 "This line uses a macro whose expansion has too many nested uses "
373 "of #foreach, #ifempty, and #ifnempty for its variable arguments. "
374 "You must simplify the expansion text to reduce the nesting (in "
375 "other words, you must reduce the number of these constructs that "
376 "are contained within the expansion areas of others of these "
377 "same constructs)." },
378
379 { TCERR_TRAILING_SP_AFTER_BS,
380 "line ends with whitespace following backslash",
381 "This line ends with one or more whitespace characters (space, tab, "
382 "etc.) following a backslash '\\'. A backslash at the end of a line "
383 "is most frequently used to indicate a continuation line, where "
384 "a long preprocessor directive is broken up over several lines "
385 "in the source file. To indicate line continuation, though, the "
386 "backslash must be the very last character on the line; because of "
387 "the extra whitespace after the backslash on this line, the "
388 "preprocessor must treat the backslash as quoting the whitespace "
389 "character that follows. If you meant to indicate line continuation, "
390 "remove the trailing whitspace. If you actually intended to escape "
391 "the whitespace character, you can suppress this warning by adding "
392 "a comment (a simple '//' is adequate) at the end of the line." },
393
394 { TCERR_EXTRA_INC_SYNTAX,
395 "extraneous characters following #include filename",
396 "This #include line has extra characters after the name of the file. "
397 "The only thing allowed on a #include line is the filename, enclosed "
398 "in quotes (\"filename\") or angle brackets (<filename>). This line "
399 "has extra characters after the filename specification. Check the "
400 "syntax and remove the extraneous text. If the extra text is "
401 "supposed to be a comment, make sure the comment syntax is correct." },
402
403 { TCERR_NESTED_COMMENT,
404 "\"/*\" found within \"/* ... */\" - nested comments are not allowed",
405 "The compiler found \"/*\" within a block comment (a \"/* ... */\" "
406 "sequence). This type of comment cannot be nested. If you didn't "
407 "intend to create a nested comment, the problem could be that the "
408 "previous block comment is missing its \"*/\" end marker - you might "
409 "want to check the previous comment to make sure it ended properly. "
410 "If you did want to create a nested comment, consider using \"//\" "
411 "comments instead, or you can use #if 0 ... #endif to comment out "
412 "a large block." },
413
414 { TCERR_UNMAPPABLE_CHAR,
415 "unmappable character in input",
416 "The compiler encountered an \"unmappable\" character in the input. "
417 "This is a character that's not defined as part of the source file "
418 "character set you're using, so the compiler doesn't know how to "
419 "interpret it. This can happen if you've declared the file to be "
420 "in plain ASCII, via a #charset \"us-ascii\" directive, but the file "
421 "actually contains characters outside of the plain ASCII range. "
422 "The same can happen with the ISO-8859 (Latin-1, etc) character sets, "
423 "since these do not define all possible character codes. Check for "
424 "any accented letters or special symbols. If you don't see any of "
425 "these, there might be invisible control characters or spaces causing "
426 "the problem. If you are intentionally using accented characters, "
427 "add a #charset directive to the start of the file to indicate the "
428 "correct character set that your text editor is using when saving "
429 "the source file." },
430
431 { TCERR_DECIMAL_IN_OCTAL,
432 "decimal digit found in octal constant \"%.*s\"",
433 "The compiler found a decimal digit (an 8 or a 9) within the octal "
434 "constant value \"%.*s\". When you start a numeric constant with the "
435 "digit zero (0), it signifies an octal constant - that is, a number "
436 "written in base-8 notation. Octal numbers can only contain the "
437 "digits 0 through 7, so you can't use an 8 or a 9 in this type of "
438 "constant. If you didn't mean this to be interpreted as an octal "
439 "value, simply remove the leading zero. Otherwise, remove the "
440 "invalid digits from the octal number." },
441
442 { TCERR_LTGT_OBSOLETE,
443 "the '<>' operator is obsolete - use '!=' instead",
444 "The '<>' operator is obsolete - use '!=' instead. TADS 2 treated "
445 "'<>' as equivalent to '!=', but TADS 3 doesn't allow '<>', because "
446 "the varying operator syntax was sometimes confusing to people "
447 "reading source code." },
448
449 { TCERR_INT_CONST_OV,
450 "constant value exceeds integer range; promoted to BigNumber",
451 "The numeric value specified is outside of the range that can be "
452 "stored in the TADS integer type (-2147483648 to +2147483647), so it "
453 "has been automatically promoted to a BigNumber (floating point) "
454 "value. BigNumber values can represent much larger numbers than "
455 "TADS integers, but some functions that require numeric arguments "
456 "only accept integer values. If you're using this value in such a "
457 "context, it might cause an error at run-time." },
458
459 { TCERR_BACKSLASH_SEQ,
460 "invalid backslash escape sequence \\%c in string",
461 "The backslash sequence \\%c is not valid." },
462
463 { TCERR_NON_ASCII_SYMBOL,
464 "symbol \"%~.*s\" contains non-ASCII character (U+%04x)",
465 "The symbol \"%~.*s\" contains one or more non-ASCII characters (the "
466 "first is [Unicode] character U+%04x). Only plain ASCII characters "
467 "can be used in symbols; accented letters and other non-ASCII "
468 "characters aren't allowed." },
469
470 { TCERR_EMBEDDING_TOO_DEEP,
471 "embedded expressions in strings are nested too deeply",
472 "The embedded \"<< >>\" expressions in this string are nested too "
473 "deeply. A nested embedding is a \"<< >>\" expression within "
474 "a string that iself contains another string that has its own "
475 "\"<< >>\" embedding, which in turn has another string with its "
476 "own embedding, and so on. This is allowed, but only to a limited "
477 "nesting depth. You will need to simplify the strings to reduce "
478 "the depth." },
479
480 { TCERR_INTERNAL_EXPLAN,
481 "Please report this error to the compiler's maintainer.",
482 "This indicates a problem within the compiler itself. Please report "
483 "this problem to the compiler's maintainer -- refer to the README file "
484 "or release notes for contact information." },
485
486 { TCERR_INTERNAL_ERROR,
487 "general internal error",
488 "general internal error" },
489
490 { TCERR_MAKE_CANNOT_CREATE_SYM,
491 "error creating symbol file \"%s\"",
492 "Error creating symbol file \"%s\". Check to make sure the filename "
493 "contains only valid characters, that the path is valid, and that "
494 "you have the required permissions to create the file." },
495
496 { TCERR_MAKE_CANNOT_CREATE_OBJ,
497 "error creating object file \"%s\"",
498 "Error creating object file \"%s\". Check to make sure the filename "
499 "contains only valid characters, that the path is valid, and that "
500 "you have the required permissions to create the file." },
501
502 { TCERR_MAKE_CANNOT_CREATE_IMG,
503 "error creating image file \"%s\"",
504 "Error creating image file \"%s\". Check to make sure the filename "
505 "contains only valid characters, that the path is valid, and that "
506 "you have the required permissions to create the file." },
507
508 { TCERR_MAKE_CANNOT_OPEN_SYM,
509 "error opening symbol file \"%s\" for reading",
510 "Error opening symbol file \"%s\" for reading. Check that the "
511 "file exists and that its name and path are valid." },
512
513 { TCERR_MAKE_CANNOT_OPEN_OBJ,
514 "error opening object file \"%s\" for reading",
515 "Error opening object file \"%s\" for reading. Check that the "
516 "file exists and that its name and path are valid." },
517
518 { TCERR_MAKE_CANNOT_OPEN_IMG,
519 "error opening image file \"%s\" for reading",
520 "Error opening image file \"%s\" for reading. Since this is an "
521 "intermediate file created during the build process, this probably "
522 "indicates a problem with the filename path, directory permissions, "
523 "or disk space." },
524
525 { TCERR_TOO_MANY_ERRORS,
526 "too many errors (try fixing the first couple of errors and recompiling)",
527 "Too many errors - aborting compilation. Don't panic! Your source "
528 "code probably doesn't have nearly as many errors as the compiler "
529 "is reporting. In all likelihood, the compiler got tripped up after "
530 "the first couple of errors and hasn't been able to get itself "
531 "re-synchronized with your code - it thinks there are errors only "
532 "because it's trying to interpret the code in the wrong context. You "
533 "should simply fix the first few errors, then try compiling your "
534 "program again - chances are the compiler will get a lot further "
535 "if you fix just the first few errors. If you want, you can save a "
536 "copy of the current source code and send it to TADS's author, who "
537 "might be able to make the compiler a little smarter about dealing "
538 "with whatever is confusing it so badly." },
539
540 { TCERR_MODULE_NAME_COLLISION,
541 "module %s the has same name as an existing module",
542 "The module \"%s\" has the same name as an existing module elsewhere "
543 "in the project. The root filename of each module must be unique, "
544 "because the two modules' object files might otherwise overwrite one "
545 "another. You must change the name of one of the modules so that "
546 "each module has a unique name." },
547
548 { TCERR_MODULE_NAME_COLLISION_WITH_LIB,
549 "module %s has the same name as an existing module from library \"%s\"",
550 "The module %s has the same name as an existing module included "
551 "from the library \"%s\". The root filename of each module must be "
552 "unique, even for files included from libraries. If more than one "
553 "module has the same root name, the modules' object files would "
554 "overwrite one another. You must change the name of this module "
555 "to a name not used anywhere else in the project." },
556
557 { TCERR_SOURCE_FROM_LIB,
558 "\"%s\" (from library \"%s\")",
559 "\"%s\" (from library \"%s\")" },
560
561 { TCERR_CANNOT_CREATE_DIR,
562 "unable to create directory \"%s\"",
563 "An error occurred creating the directory/folder \"%s\". This might "
564 "mean that the name contains invalid characters, the disk is "
565 "full, or you don't have the necessary permissions or privileges "
566 "to create a new file in the parent folder." },
567
568 { TCERR_CONST_DIV_ZERO,
569 "divide by zero in constant expression",
570 "Division by zero in constant expression. (The compiler was trying "
571 "to calculate the value of this expression because it appears to be "
572 "constant. Check for any macros that might expand to zero, and check "
573 "for proper placement of parentheses.)" },
574
575 { TCERR_NO_MEM_PRS_TREE,
576 "out of memory - cannot allocate parse tree block",
577 "Out of memory. (The compiler was trying to allocate space for a "
578 "\"parse tree block,\" which stores an intermediate form of your "
579 "program source code during compilation. If possible, make more "
580 "memory available to the compiler by closing other applications or "
581 "reconfiguring any background tasks, services, or device drivers "
582 "that can be changed to use less memory.)" },
583
584 { TCERR_PRS_BLK_TOO_BIG,
585 "parse block too big (size=%ld)",
586 "Parse block too big (size=%ld)." },
587
588 { TCERR_INVALID_LVALUE,
589 "invalid lvalue - cannot assign to expression on left of \"%s\"",
590 "Invalid \"lvalue\". The expression on the left-hand side of the "
591 "operator \"%s\" cannot be used as the destination of an assignment. "
592 "You can only assign values to expressions such as local variables, "
593 "object properties, and list elements. "
594 "Check for missing or extra parentheses and operators. " },
595
596 { TCERR_QUEST_WITHOUT_COLON,
597 "missing ':' in '?' conditional expression",
598 "The ':' part of a '?' conditional expression is missing. A '?' "
599 "expression uses the syntax (condition ? true-part : false-part). "
600 "Check for missing parentheses or other errors in the "
601 "condition or true-part expression." },
602
603 { TCERR_INVALID_UNARY_LVALUE,
604 "invalid lvalue - cannot apply \"%s\" operator to expression",
605 "The \"%s\" operator cannot be applied to this expression. This "
606 "operator can only be applied to an expression that can be used in "
607 "an assignment, such as local variables, object properties, and "
608 "list elements. Check for missing or extra parentheses." },
609
610 { TCERR_DELETE_OBSOLETE,
611 "operator 'delete' is obsolete; expression has no effect",
612 "The 'delete' operator is obsolete. The compiler still accepts "
613 "'delete' expressions, but they have no effect at run-time. (The "
614 "run-time system now provides automatic deletion of objects as "
615 "they become unreachable, so explicit deletion is no longer "
616 "necessary. You can simply remove all 'delete' expressions from "
617 "your program.)" },
618
619 { TCERR_NO_ADDRESS,
620 "invalid address expression - can't apply '&' operator",
621 "The unary '&' operator cannot be applied to this expression. You "
622 "can only apply the '&' prefix operator to function names and property "
623 "names. Check the expression after the '&' to make sure it is a valid "
624 "function or property name, and check for other expression errors, "
625 "such as unbalanced parentheses." },
626
627 { TCERR_CONST_UNARY_REQ_NUM,
628 "unary '%s' operator requires numeric value in constant expression",
629 "The '%s' operator must be followed by a numeric value in a constant "
630 "expression. The value after the operator is a constant value, but "
631 "is not a number." },
632
633 { TCERR_CONST_BINARY_REQ_NUM,
634 "binary '%s' operator requires numeric value in constant expression",
635 "The '%s' operator must be applied only to numeric values in a constant "
636 "expression. Both of the values are constants, but both are not "
637 "numbers." },
638
639 { TCERR_CONST_BINPLUS_INCOMPAT,
640 "incompatible constant types for two-operand '+' operator",
641 "The constant types in this expression are not compatible for use "
642 "with the two-operand '+' operator. You can add two numbers, or add a "
643 "non-list value to a string, or add a value to a list; other "
644 "combinations are not allowed." },
645
646 { TCERR_EXPR_MISSING_RPAR,
647 "expected ')' but found \"%~.*s\"",
648 "This expression is missing a right parenthesis ')' - \"%~.*s\" is "
649 "where the ')' should go. The parenthesis is required to "
650 "match an earlier left parenthesis '('. Check to make sure the "
651 "parentheses are properly balanced, and check for unterminated "
652 "strings and missing operators." },
653
654 { TCERR_BAD_PRIMARY_EXPR,
655 "expected integer, string, symbol, '[', or '(', but found \"%~.*s\"",
656 "Invalid expression; expected an integer value, a string value (in "
657 "single or double quotes), a symbolic name (such as a function, "
658 "object, or property name), a list constant enclosed in square "
659 "brackets '[ ]', or an expression in parentheses '( )', but "
660 "found \"%~.*s\"." },
661
662 { TCERR_CONST_BAD_COMPARE,
663 "incompatible types for comparison in constant expression",
664 "This constant expression contains a comparison operator ('<', '<=', "
665 "'>', or '>=') that attempts to compare values of incompatible types "
666 "(you can compare an integer to an integer, a string to a string, "
667 "or a floating-point value to another floating point value). Check "
668 "the expression and correct the invalid comparison." },
669
670 { TCERR_EXPECTED_SEMI,
671 "expected ';', but found \"%~.*s\"",
672 "Expected a semicolon ';' but found \"%~.*s\". Please add the "
673 "required semicolon. If a semicolon is already present, check "
674 "for unbalanced parentheses or other expression errors." },
675
676 { TCERR_EXPECTED_STR_CONT,
677 "expected '>>' and the string continuation, but found \"%~.*s\"",
678 "Expected '>>' after the embedded expression, followed by the "
679 "continuation of the string, but found \"%~.*s\" instead. Check the "
680 "embedded expression (between '<<' and '>>') for errors, such as "
681 "unbalanced parentheses, and check that the string is properly "
682 "continued after a '>>' sequence." },
683
684 { TCERR_EXPECTED_ARG_COMMA,
685 "expected ',' or ')' in argument list, but found \"%~.*s\"",
686 "Expected a comma ',' or right parenthesis ')' in an argument list, "
687 "but found \"%~.*s\". Arguments must be separated by commas, and "
688 "the entire list must be enclosed in parentheses '( )'. Check for "
689 "errors and unbalanced parentheses in the argument expression." },
690
691 { TCERR_EXPECTED_SUB_RBRACK,
692 "expected ']' at end of subscript, but found \"%~.*s\"",
693 "Expected a right square bracket ']' at the end of the subscript "
694 "(index) expression, but found \"%~.*s\" instead. A ']' is required "
695 "to match the '[' at the start of the subscript. Check for errors "
696 "and unbalanced parentheses in the subscript expression." },
697
698 { TCERR_INVALID_PROP_EXPR,
699 "expected property name or parenthesized expression after '.', "
700 "found \"%~.*s\"",
701 "Expected a property name or a parenthesized expression (which must "
702 "evaluate at run-time to a property address value) after '.', but "
703 "found \"%~.*s\", which is not a valid property-valued expression." },
704
705 { TCERR_LIST_MISSING_RBRACK,
706 "expected ']' or a list element, but found \"%~.*s\"",
707 "Expected to find a list element expression or a right square "
708 "bracket ']' ending the list, but found \"%~.*s\" instead. "
709 "The compiler will assume that this is the end of the list. "
710 "Please insert the missing ']', or check for errors in the list "
711 "expressions." },
712
713 { TCERR_LIST_EXTRA_RPAR,
714 "found extraneous ')' in list; ignored",
715 "Found an extra right parenthesis ')' where a list element "
716 "expression or a right square bracket ']' ending the list should be. "
717 "The compiler will assume that the ')' is extraneous and will "
718 "ignore it. Please remove the extra ')' or check the list "
719 "for unbalanced parentheses or other expression errors." },
720
721 { TCERR_LIST_EXPECT_COMMA,
722 "expected ',' separating list elements, but found \"%~.*s\"",
723 "A comma ',' must be used to separate each element of a list. "
724 "The compiler found \"%~.*s\" where a comma should be. Please insert "
725 "the missing comma between the list elements, or check for an "
726 "error in the preceding list element expression." },
727
728 { TCERR_CONST_IDX_NOT_INT,
729 "index value must be an integer in constant list index expression",
730 "The list index expression has a constant value, but the list index "
731 "is not a number. A list index must have a numeric value. Check "
732 "the expression in the square brackets '[ ]' and correct any errors." },
733
734 { TCERR_CONST_IDX_RANGE,
735 "index value out of range in constant list index expression",
736 "The list index expression is out of range for the list. The index "
737 "value must be a number from 1 to the number of elements in the "
738 "list. Check the expression in the square brackets '[ ]' and "
739 "correct the value." },
740
741 { TCERR_UNTERM_STRING,
742 "unterminated string literal: string started with %c%~.*s%c",
743 "Unterminated string. The string starting with %c%~.*s%c does not have a "
744 "matching close quote before the end of the file. Please insert the "
745 "missing quote mark. If the string looks properly terminated, check "
746 "the previous string (or the previous few strings), since an unbalanced "
747 "quote mark in an earlier string can sometimes propagate to later "
748 "strings." },
749
750 { TCERR_EXPECTED_ARG_RPAR,
751 "expected ')' at end of argument list, but found \"%~.*s\"",
752 "Expected a right parenthesis ')' at the end of an argument list, "
753 "but found \"%~.*s\". The compiler is assuming that this is the end "
754 "of the statement. Please insert the missing parenthesis, or check "
755 "the argument list for unbalanced parentheses or other errors." },
756
757 { TCERR_EXTRA_RPAR,
758 "unexpected ')' found - ignored",
759 "The expression contains an unbalanced right parenthesis ')'. "
760 "The compiler will ignore the extra ')'. Remove the extra ')', "
761 "or check the expression for other errors." },
762
763 { TCERR_EXTRA_RBRACK,
764 "unexpected ']' found - ignored",
765 "The expression contains an unbalanced right square bracket ']'. "
766 "The compiler will ignore the extra ']'. Remove the extra ']', "
767 "or check the expression for other errors." },
768
769 { TCERR_EXPECTED_OPERAND,
770 "expected an operand, but found \"%~.*s\"",
771 "The expression is missing an operand value - the compiler found "
772 "\"%~.*s\" instead of a valid operand. Please check the expression and "
773 "correct the error." },
774
775 { TCERR_PROPSET_REQ_STR,
776 "expected property name pattern string after 'propertyset' - "
777 "found \"%~.*s\"",
778 "A property name pattern string, enclosed in single quotes, is "
779 "required after the 'propertyset' keyword, but the compiler found "
780 "\"%~.*s\" instead. Add the missing pattern string." },
781
782 { TCERR_INH_CLASS_SYNTAX,
783 "\"inherited superclass\" syntax - expected '.', found \"%~.*s\"",
784 "Invalid syntax in \"inherited class\" expression. The class name "
785 "must be followed by '.', but the compiler found \"%~.*s\" instead. "
786 "Check and correct the syntax." },
787
788 { TCERR_UNDEF_SYM,
789 "undefined symbol \"%~.*s\"",
790 "The symbol \"%~.*s\" is not defined. Check the spelling of the "
791 "symbol name, and make sure that the corresponding local variable, "
792 "object, or function definition is entered correctly. This error "
793 "could be the result of a syntax error in the original declaration "
794 "of the symbol; if the declaration has an error, correct that error "
795 "first, then try recompiling." },
796
797 { TCERR_ASSUME_SYM_PROP,
798 "undefined symbol \"%~.*s\" - assuming this is a property name",
799 "The symbol \"%~.*s\" is undefined, but appears from context to be "
800 "a property name. The compiler is assuming that this is a property. "
801 "Check the spelling of the symbol. If this assumption is correct, "
802 "you can avoid this warning by explicitly declaring a value to the "
803 "property in an object definition rather than in method code." },
804
805 { TCERR_CONST_BINMINUS_INCOMPAT,
806 "incompatible constant types for two-operand '-' operator",
807 "The constant types in this expression are not compatible for use "
808 "with the two-operand '-' operator. You can subtract one number "
809 "from another, or subtract a value from a list; other combinations "
810 "are not allowed." },
811
812 { TCERR_REQ_SYM_FORMAL,
813 "expected a symbol in formal parameter list, but found \"%~.*s\"",
814 "A symbol name is required for each formal parameter. The compiler "
815 "found \"%~.*s\" instead of a symbol for the parameter name." },
816
817 { TCERR_REQ_COMMA_FORMAL,
818 "expected a comma in formal parameter list, but found \"%~.*s\"",
819 "The formal parameter list is missing a comma between two parameter "
820 "names - a comma should come before \"%~.*s\" in the parameter list." },
821
822 { TCERR_MISSING_LAST_FORMAL,
823 "missing parameter name at end of formal parameter list",
824 "The last parameter name in the formal parameter list is missing. "
825 "Insert a parameter name before the ')', or remove the extra comma "
826 "at the end of the list." },
827
828 { TCERR_MISSING_RPAR_FORMAL,
829 "missing right parenthesis ')' at end of formal parameter list - "
830 "found \"%~.*s\"",
831 "The right parenthesis ')' at the end of the formal parameter list "
832 "is missing. The parenthesis should come before \"%~.*s\". " },
833
834 { TCERR_FORMAL_REDEF,
835 "formal parameter \"%~.*s\" defined more than once",
836 "The formal parameter name \"%~.*s\" is defined more than once in the "
837 "parameter list. Each parameter name can be used only once in the "
838 "same list. Remove the redundant variable, or change its name." },
839
840 { TCERR_EQ_WITH_METHOD_OBSOLETE,
841 "'=' is not allowed with a method definition",
842 "An equals sign '=' is not allowed in a method definition. You can "
843 "only use '=' when defining a simple value for a property, not to "
844 "define method code. (TADS 2 used '=' in methods, but this syntax is "
845 "now obsolete.) Remove the '='." },
846
847 { TCERR_REQ_LBRACE_CODE,
848 "expected '{' at start of method code body, but found \"%~.*s\"",
849 "An open brace '{' was expected before a method's program code body, "
850 "but the compiler found \"%~.*s\" instead." },
851
852 { TCERR_EOF_IN_CODE,
853 "unexpected end of file in code block - '}' missing",
854 "The compiler reached the end of the file before the current function "
855 "or method was finished. A close brace '}' is probably missing - "
856 "insert the close brace at the end of the function or method." },
857
858 { TCERR_REQ_LPAR_IF,
859 "expected '(' after \"if\", but found \"%~.*s\"",
860 "An open parenthesis '(' is required after the keyword \"if\" - "
861 "the compiler found \"%~.*s\" instead. The compiler will assume "
862 "that a parenthesis was intended. Please correct the syntax "
863 "by inserting a parenthesis." },
864
865 { TCERR_MISPLACED_ELSE,
866 "misplaced \"else\" - no corresponding \"if\" statement",
867 "This \"else\" clause is invalid because it is not properly associated "
868 "with an \"if\" statement. Most likely, this is because the group of "
869 "statements following the \"if\" is not properly enclosed in braces "
870 "'{ }', or because the braces just before the \"else\" aren't properly "
871 "balanced, or because there are too many or too few semicolons ';' after "
872 "the statement following the \"if\" and before the \"else\". Check "
873 "braces to make sure they're properly balanced, and check the statement "
874 "or statements before the \"else\" for proper syntax, especially "
875 "for the correct number of terminating semicolons." },
876
877 { TCERR_MISPLACED_CASE,
878 "misplaced \"case\" keyword - not in a \"switch\" statement",
879 "This \"case\" clause is invalid because it is not part of a \"switch\" "
880 "statement. The most likely cause is that braces before this \"case\" "
881 "keyword aren't properly balanced. \"case\" labels must be enclosed "
882 "directly by the \"switch\" - they cannot be enclosed within statements "
883 "or braces inside the \"switch\". Check code preceding the \"case\" "
884 "clause for proper syntax and balanced braces." },
885
886 { TCERR_MISPLACED_DEFAULT,
887 "misplaced \"default\" keyword - not in a \"switch\" statement",
888 "This \"default\" clause is invalid because it is not part of a "
889 "\"switch\" statement. The most likely cause is that braces before "
890 "this \"default\" keyword aren't properly balanced. A \"default\" "
891 "label must be enclosed directly by the \"switch\" - it cannot be "
892 "enclosed within a statement or braces within the \"switch\" body. "
893 "Check code preceding the \"default\" clause for proper syntax "
894 "and balanced braces." },
895
896 { TCERR_ELLIPSIS_NOT_LAST,
897 "'...' cannot be followed by additional formal parameters",
898 "An ellipsis '...' cannot be followed by additional parameters "
899 "in an argument list. Move the '...' to the end of the parameter "
900 "list, or remove the extraneous parameters after the ellipsis." },
901
902 { TCERR_LOCAL_REQ_COMMA,
903 "expected ',' or ';' after local variable, but found \"%~.*s\"",
904 "The compiler expected a comma ',' or semicolon ';' after a local "
905 "variable declaration, but found \"%~.*s\" instead. If you're "
906 "defining an additional variable, add a comma before the additional "
907 "variable; if not, check for a missing semicolon." },
908
909 { TCERR_LOCAL_REQ_SYM,
910 "expected symbol name in local variable declaration, but found \"%~.*s\"",
911 "A symbol name is required in the local variable declaration, "
912 "but the compiler found \"%~.*s\" instead. Check the syntax "
913 "and correct the error." },
914
915 { TCERR_FUNC_REQ_SYM,
916 "expected symbol after 'function', but found \"%~.*s\"",
917 "A symbol name is required after the 'function' keyword, but the "
918 "compiler found \"%~.*s\" instead. Check the function definition "
919 "syntax." },
920
921 { TCERR_REQ_CODE_BODY,
922 "expected ';', '(', or '{', but found \"%~.*s\"",
923 "The compiler expected a left parenthesis '(' starting a formal "
924 "parameter list, a left brace '{' starting a code body, or a semicolon "
925 "';' terminating the statement, but found \"%~.*s\". Check the function "
926 "definition syntax." },
927
928 { TCERR_REQ_FUNC_OR_OBJ,
929 "expected function or object definition, but found \"%~.*s\"",
930 "The compiler expected a function or object definition, but "
931 "found \"%~.*s\". Check the syntax, and check for unbalanced "
932 "braces '{ }' and other syntax errors preceding this line." },
933
934 { TCERR_RET_REQ_EXPR,
935 "expected ';' or expression after \"return\", but found \"%~.*s\"",
936 "The \"return\" keyword must be followed by an expression giving the "
937 "value to return, or by a semicolon ';' if there is no value to "
938 "return; the compiler found \"%~.*s\" instead. Check the syntax, and "
939 "insert the missing semicolon or expression as appropriate." },
940
941 { TCERR_UNREACHABLE_CODE,
942 "unreachable statement",
943 "This statement cannot be reached, because the previous statement "
944 "returns or throws an exception. This code will never be executed. "
945 "Check the logic to determine if the code is necessary; if not, "
946 "remove the code. If the code is necessary, you must determine "
947 "why the code is unreachable and correct the program logic." },
948
949 { TCERR_RET_VAL_AND_VOID,
950 "code has \"return\" statements both with and without values",
951 "This code has \"return\" statements both with and without values. "
952 "A function or method's \"return\" statements should consistently "
953 "return values or not; these should not be mixed in a single "
954 "function or method, because callers will not have predictable "
955 "results when using the function's return value." },
956
957 { TCERR_RET_VAL_AND_IMP_VOID,
958 "code has \"return\" with value but also falls off end",
959 "This code has one or more \"return\" statements that explicitly "
960 "return a value from the function, but also \"falls off\" the end "
961 "of the function without a \"return\" statement, which will result "
962 "in a return without a value. The last statement in the function "
963 "or method should be a \"return\" with a value, for consistency "
964 "with the other \"return\" statements." },
965
966 { TCERR_REQ_INTRINS_NAME,
967 "expected function set name string after \"intrinsic\", "
968 "but found \"%~.*s\"",
969 "The \"intrinsic\" keyword must be followed by the global name of the "
970 "function set, enclosed in single-quotes, but the compiler found "
971 "\"%~.*s\" instead. Check the \"intrinsic\" statement syntax." },
972
973 { TCERR_REQ_INTRINS_LBRACE,
974 "expected '{' after intrinsic name, but found \"%~.*s\"",
975 "The function set listing for an \"intrinsic\" statement must be "
976 "closed in braces '{ }'. The compiler found \"%~.*s\" after the "
977 "function set name, where the open brace '{' should be. Check the "
978 "syntax." },
979
980 { TCERR_EOF_IN_INTRINS,
981 "end of file in \"intrinsic\" list - '}' is probably missing",
982 "The compiler reached the end of the file while still scanning "
983 "an \"intrinsic\" statement's function set listing. The closing "
984 "brace '}' of the function set list is probably missing; check "
985 "for the missing brace." },
986
987 { TCERR_REQ_INTRINS_LPAR,
988 "expected '(' after function name in intrinsic list, but found \"%~.*s\"",
989 "An open parenthesis '(' is required after the name of a function "
990 "in an intrinsic function list, but the compiler found \"%~.*s\" "
991 "instead. Check the syntax and insert the missing parenthesis." },
992
993 { TCERR_REQ_INTRINS_SYM,
994 "expected function name in intrinsic list, but found \"%~.*s\"",
995 "The compiler expected the name of a function in the intrinsic "
996 "function list, but found \"%~.*s\" instead. Check the syntax of "
997 "the statement, and check for unbalanced parentheses and braces." },
998
999 { TCERR_REQ_FOR_LPAR,
1000 "expected '(' after \"for\", but found \"%~.*s\"",
1001 "An open parenthesis '(' is required after the \"for\" keyword, "
1002 "but the compiler found \"%~.*s\" instead. Check the syntax "
1003 "and insert the missing parenthesis." },
1004
1005 { TCERR_LOCAL_REDEF,
1006 "local variable \"%~.*s\" defined more than once",
1007 "The local variable name \"%~.*s\" is defined more than once in this "
1008 "scope. Each local variable name can be used only once at the same "
1009 "level of braces '{ }'. Remove the redundant variable, or change its "
1010 "name." },
1011
1012 { TCERR_REQ_FOR_LOCAL_INIT,
1013 "initializer expected after local variable name in \"for\", but found "
1014 "\"%~.*s\"",
1015 "A local variable defined within a \"for\" statement's initialization "
1016 "clause requires an initializer expression. The compiler expected to "
1017 "find an assignment operator after the local variable name, but found "
1018 "\"%~.*s\" instead. Check the syntax, and add the missing initializer "
1019 "to the local variable definition." },
1020
1021 { TCERR_MISSING_FOR_INIT_EXPR,
1022 "missing expression after comma in \"for\" initializer",
1023 "An expression must follow a comma in a \"for\" initializer list. "
1024 "Check the expression, and remove the extra comma before the "
1025 "semicolon, or supply the missing expression." },
1026
1027 { TCERR_MISSING_FOR_PART,
1028 "missing expression in \"for\" statement - expected ';', found '%~.*s'",
1029 "A \"for\" statement requires three expressions, separated by "
1030 "semicolons ';'. This statement doesn't seem to have all of the required "
1031 "parts - it ends unexpectedly at \"%~.*s\". Add the missing "
1032 "parts or correct the syntax." },
1033
1034 { TCERR_REQ_FOR_INIT_COMMA,
1035 "expected ',' or ';' in \"for\" initializer, but found \"%~.*s\"",
1036 "A comma ',' or semicolon ';' was expected in the \"for\" statement's "
1037 "initializer list, but the compiler found \"%~.*s\" instead. Check "
1038 "the expression syntax." },
1039
1040 { TCERR_REQ_FOR_COND_SEM,
1041 "expected ';' after \"for\" condition, but found \"%~.*s\"",
1042 "A semicolon ';' was expected after the \"for\" statement's "
1043 "condition expression, but the compiler found \"%~.*s\" instead. "
1044 "Check the expression syntax." },
1045
1046 { TCERR_REQ_FOR_RPAR,
1047 "missing ')' at end of \"for\" expression list - found \"%~.*s\"",
1048 "A closing parenthesis ')' is required at the end of the \"for\" "
1049 "statement's expression list, but the compiler found \"%~.*s\" instead. "
1050 "Check the syntax, and insert the missing parenthesis, or correct "
1051 "unbalanced parentheses or other syntax errors earlier in the "
1052 "expression list." },
1053
1054 { TCERR_FOR_COND_FALSE,
1055 "\"for\" condition is always false - body and reinitializer are "
1056 "unreachable",
1057 "The condition of this \"for\" statement is always false, so the "
1058 "body and reinitialization expression will never be executed." },
1059
1060 { TCERR_REQ_WHILE_LPAR,
1061 "missing '(' after \"while\" - found \"%~.*s\"",
1062 "An open parenthesis '(' is required after the \"while\" keyword, but "
1063 "the compiler found \"%~.*s\" instead. Check the syntax and insert "
1064 "the missing parenthesis." },
1065
1066 { TCERR_REQ_WHILE_RPAR,
1067 "missing ')' after \"while\" expression - found \"%~.*s\"",
1068 "A close parenthesis ')' is required after the expression condition "
1069 "in a \"while\" statement, but the compiler found \"%~.*s\" instead. "
1070 "Check the syntax and insert the missing parenthesis." },
1071
1072 { TCERR_WHILE_COND_FALSE,
1073 "\"while\" condition is always false - loop body is unreachable",
1074 "The condition of this \"while\" statement is always false, so the "
1075 "body of the loop will never be executed." },
1076
1077 { TCERR_REQ_DO_WHILE,
1078 "expected \"while\" in \"do\" statement, but found \"%~.*s\"",
1079 "This \"do\" statement is missing the required \"while\" keyword "
1080 "immediately after the loop body. The compiler found \"%~.*s\" where "
1081 "the \"while\" keyword shuld be. Check the syntax and insert the "
1082 "missing \"while\" keyword." },
1083
1084 { TCERR_MISPLACED_CATCH,
1085 "misplaced \"catch\" clause - must be associated with \"try\"",
1086 "This \"catch\" clause is invalid because it is not part of a \"try\""
1087 " statement. The most likely cause is that braces before this \"catch\""
1088 " keyword aren't properly balanced. Check braces preceding the "
1089 "\"catch\" clause for proper syntax." },
1090
1091 { TCERR_MISPLACED_FINALLY,
1092 "misplaced \"finally\" clause - must be associated with \"try\"",
1093 "This \"finally\" clause is invalid because it is not part of a \"try\""
1094 " statement. The most likely cause is that braces before this "
1095 "\"finally\" keyword aren't properly balanced. Check braces "
1096 "preceding the \"finally\" clause for proper syntax." },
1097
1098 { TCERR_REQ_SWITCH_LPAR,
1099 "missing '(' after \"switch\" - found \"%~.*s\"",
1100 "An open parenthesis '(' is required after the \"switch\" keyword, but "
1101 "the compiler found \"%~.*s\" instead. Check the syntax and insert "
1102 "the missing parenthesis." },
1103
1104 { TCERR_REQ_SWITCH_RPAR,
1105 "missing ')' after \"switch\" expression - found \"%~.*s\"",
1106 "A close parenthesis ')' is required after the controlling expression "
1107 "of a \"switch\" statement, but the compiler found \"%~.*s\" instead. "
1108 "Check the syntax and insert the missing parenthesis." },
1109
1110 { TCERR_REQ_SWITCH_LBRACE,
1111 "missing '{' after \"switch\" expression - found \"%~.*s\"",
1112 "An open brace '{' is required after the controlling expression "
1113 "of a \"switch\" statement, but the compiler found \"%~.*s\" instead. "
1114 "The body of the \"switch\" must be enclosed in braces '{ }'. "
1115 "Check the syntax and insert the missing parenthesis." },
1116
1117 { TCERR_UNREACHABLE_CODE_IN_SWITCH,
1118 "code before first \"case\" or \"default\" label in \"switch\" is "
1119 "not allowed",
1120 "This statement precedes the first \"case\" or \"default\" label "
1121 "in the \"switch\" body - all code within a \"switch\" body must "
1122 "be reachable from a \"case\" or \"default\" label. Even \"local\" "
1123 "declarations must be within a labelled section of the \"switch\" "
1124 "body. Check for a missing \"case\" label, or move the code so that "
1125 "it is outside the \"switch\" body or after a \"case\" label." },
1126
1127 { TCERR_EOF_IN_SWITCH,
1128 "end of file in \"switch\" body",
1129 "End of file found in \"switch\" body. The \"switch\" body's "
1130 "braces '{ }' are probably not properly balanced. Check the code "
1131 "within the \"switch\" body for unbalanced braces and other errors." },
1132
1133 { TCERR_CODE_LABEL_REDEF,
1134 "code label \"%~.*s\" already defined in this function or method",
1135 "The code label \"%~.*s\" is already defined in this function or "
1136 "method. A code label can be used only once within each function "
1137 "or method; code labels always have function- or method-level scope, "
1138 "even when they're nested within braces. Change the name of one of "
1139 "the conflicting labels so that the two labels have different names." },
1140
1141 { TCERR_REQ_CASE_COLON,
1142 "missing ':' after \"case\" expression - found \"%~.*s\"",
1143 "A colon ':' is required after the \"case\" expression, but the "
1144 "compiler found \"%~.*s\" instead. Check the expression for errors, "
1145 "and insert the missing colon after the expression." },
1146
1147 { TCERR_CASE_NOT_CONSTANT,
1148 "\"case\" expression has a non-constant value",
1149 "The expression in this \"case\" label does not have a constant "
1150 "value. \"case\" expressions must always be constants or expressions "
1151 "involving only constants. Check the expression and remove "
1152 "references to local variables, object properties, or any other "
1153 "non-constant values." },
1154
1155 { TCERR_REQ_DEFAULT_COLON,
1156 "missing ':' after \"default\" - found \"%~.*s\"",
1157 "A colon ':' is required after the \"default\" keyword, but the "
1158 "compiler found \"%~.*s\" instead. Insert the missing colon "
1159 "after the keyword." },
1160
1161 { TCERR_DEFAULT_REDEF,
1162 "this \"switch\" already has a \"default:\" label",
1163 "This \"switch\" statement already has a \"default:\" label. A "
1164 "\"switch\" statement can have at most one \"default:\" label. Remove "
1165 "the redundant label." },
1166
1167 { TCERR_TRY_WITHOUT_CATCH,
1168 "\"try\" statement has no \"catch\" or \"finally\" clauses",
1169 "This \"try\" statement has no \"catch\" or \"finally\" clauses. A "
1170 "\"try\" statement must have at least one such clause, since it is "
1171 "otherwise superfluous. Check for unbalanced braces in the body of "
1172 "the \"try\" block." },
1173
1174 { TCERR_REQ_CATCH_LPAR,
1175 "missing '(' after \"catch\" - found \"%~.*s\"",
1176 "An open parenthesis '(' is required after the \"catch\" keyword, but "
1177 "the compiler found \"%~.*s\" instead. Check the syntax and insert "
1178 "the missing parenthesis." },
1179
1180 { TCERR_REQ_CATCH_RPAR,
1181 "missing ')' after \"catch\" variable name - found \"%~.*s\"",
1182 "A close parenthesis ')' is required after the variable name "
1183 "of a \"switch\" clause, but the compiler found \"%~.*s\" instead. "
1184 "Check the syntax and insert the missing parenthesis." },
1185
1186 { TCERR_REQ_CATCH_CLASS,
1187 "expected class name in \"catch\" clause - found \"%~.*s\"",
1188 "The class name of the exception to catch is required in the "
1189 "\"catch\" clause, but the compiler found \"%~.*s\" instead. Check "
1190 "and correct the syntax." },
1191
1192 { TCERR_REQ_CATCH_VAR,
1193 "expected variable name in \"catch\" clause - found \"%~.*s\"",
1194 "The name of a local variable (which can either be an existing "
1195 "variable or can be a new variable implicitly defined by this use) "
1196 "is required in the \"catch\" clause, but the compiler found \"%~.*s\" "
1197 "instead. Check and correct the syntax." },
1198
1199 { TCERR_CATCH_VAR_NOT_LOCAL,
1200 "\"%~.*s\" is not a local variable, so is not a valid \"catch\" target "
1201 "variable",
1202 "The symbol \"%~.*s\" is defined as something other than a local "
1203 "variable, so it cannot be used as the target of this \"catch\" clause. "
1204 "Check for a conflicting symbol, and either remove the conflicting "
1205 "symbol or rename the \"catch\" variable." },
1206
1207 { TCERR_BREAK_REQ_LABEL,
1208 "label name expected after \"break\", but found \"%~.*s\"",
1209 "A label name was expected after the \"break\" keyword, but the "
1210 "compiler found \"%~.*s\" instead. This might indicate that a "
1211 "semicolon after \"break\" is missing. Check the syntax." },
1212
1213 { TCERR_CONT_REQ_LABEL,
1214 "label name expected after \"continue\", but found \"%~.*s\"",
1215 "A label name was expected after the \"continue\" keyword, but the "
1216 "compiler found \"%~.*s\" instead. This might indicate that a "
1217 "semicolon after \"continue\" is missing. Check the syntax." },
1218
1219 { TCERR_GOTO_REQ_LABEL,
1220 "label name expected after \"goto\", but found \"%~.*s\"",
1221 "A label name was expected after the \"goto\" keyword, but the "
1222 "compiler found \"%~.*s\" instead. Check the syntax and insert "
1223 "the missing label name." },
1224
1225 { TCERR_REDEF_AS_FUNC,
1226 "symbol \"%~.*s\" is already defined - can't redefine as function",
1227 "The symbol \"%~.*s\" is already defined, so you cannot use it "
1228 "as the name of a function here. This symbol is already being "
1229 "used as the name of an object or property elsewhere "
1230 "in your program. Change the name to a unique symbol." },
1231
1232 { TCERR_INVAL_EXTERN,
1233 "invalid \"extern\" type specifier \"%~.*s\"",
1234 "Invalid keyword \"%~.*s\" following \"extern\". The \"extern\" "
1235 "keyword must be followed by \"function\" or \"object\" to indicate "
1236 "the type of the external symbol to declare." },
1237
1238 { TCERR_EXTERN_NO_CODE_BODY,
1239 "code body is not allowed in an \"extern function\" declaration",
1240 "This \"extern function\" declaration is not valid because it has "
1241 "a left brace introducing a code body after the function prototype. "
1242 "An extern function declaration can have only the prototype, because "
1243 "it specifies that the actual code body of the function is defined "
1244 "in another module. Either remove the \"extern\" keyword or remove "
1245 "the code body." },
1246
1247 { TCERR_FUNC_REDEF,
1248 "function \"%~.*s\" is already defined",
1249 "The function \"%~.*s\" is already defined earlier in the program. "
1250 "Each function must have a unique name. Remove the redundant "
1251 "definition or change the name of one of the functions." },
1252
1253 { TCERR_INCOMPAT_FUNC_REDEF,
1254 "function \"%~.*s\" has an incompatible previous declaration",
1255 "The function \"%~.*s\" has an incompatible declaration previously "
1256 "in the program. The earlier definition could be from an \"extern\" "
1257 "declaration in this source file, or it could come from a symbol "
1258 "file for another module in your program. Each definition of "
1259 "a function must declare the same parameter list for the function. "
1260 "Check for other declarations of this function and correct the "
1261 "inconsistency." },
1262
1263 { TCERR_OBJDEF_REQ_COLON,
1264 "expected ':' after object name in object definition, but found \"%~.*s\"",
1265 "A colon ':' is required after the object name in an object "
1266 "definition, but the compiler found \"%~.*s\" instead. Check the "
1267 "object syntax and insert the missing colon." },
1268
1269 { TCERR_OBJDEF_REQ_SC,
1270 "expected superclass name in object definition, but found \"%~.*s\"",
1271 "The name of a superclass was expected in the object definition, "
1272 "but the compiler found \"%~.*s\". Check the object syntax; add or "
1273 "correct the superclass name, or correct other syntax errors." },
1274
1275 { TCERR_OBJDEF_OBJ_NO_SC,
1276 "superclasses cannot be specified with \"object\" as the base class",
1277 "This object specifies \"object\" as the base class, but also lists "
1278 "named superclasses. This is not valid -- a basic \"object\" "
1279 "definition cannot also specify named superclasses." },
1280
1281 { TCERR_REDEF_AS_OBJ,
1282 "symbol \"%~.*s\" is already defined - can't redefine as object",
1283 "The symbol \"%~.*s\" is already defined, so you cannot use it "
1284 "as the name of an object here. This symbol is already being "
1285 "used as the name of a function or property elsewhere "
1286 "in your program. Change the name to a unique symbol." },
1287
1288 { TCERR_OBJ_REDEF,
1289 "object \"%~.*s\" is already defined - can't redefine as object",
1290 "The object \"%~.*s\" is already defined earlier in the program. "
1291 "Each object must have a unique name. Remove the redundant "
1292 "definition or change the name of one of the objects." },
1293
1294 { TCERR_OBJDEF_REQ_PROP,
1295 "expected property name in object definition, but found \"%~.*s\"",
1296 "A property name was expected in the object definition, but the "
1297 "compiler found \"%~.*s\" instead. Check for a missing semicolon at the "
1298 "end of the object definition, and check for unbalanced "
1299 "braces prior to this line." },
1300
1301 { TCERR_REDEF_AS_PROP,
1302 "symbol \"%~.*s\" is already defined - can't redefine as property",
1303 "The symbol \"%~.*s\" is already defined, so you cannot use it as "
1304 "the name of a property here. The symbol is already being "
1305 "used as the name of an object or function elsewhere in the program. "
1306 "Change the name to a unique symbol." },
1307
1308 { TCERR_OBJDEF_REQ_PROPVAL,
1309 "expected property value or method after property name \"%~.*s\", "
1310 "but found \"%~.*s\"",
1311 "A property value or method was expected after the property "
1312 "name \"%~.*s\", but the compiler found \"%~.*s\". Check the syntax "
1313 "and supply a property value expression or method code in braces '{ }'."},
1314
1315 { TCERR_REPLACE_REQ_OBJ_OR_FUNC,
1316 "expected \"function\" or object name after \"replace\", but found "
1317 "\"%~.*s\"",
1318 "The keyword \"replace\" must be followed by \"function\" or by an "
1319 "object name, but the compiler found \"%~.*s\" instead." },
1320
1321 { TCERR_REPMODOBJ_UNDEF,
1322 "replace/modify cannot be used with an object not previously defined",
1323 "The \"replace\" and \"modify\" keywords cannot be used with an object "
1324 "that is not previously defined. The object must at least be defined "
1325 "as an \"extern\" object before it can be replaced or modified." },
1326
1327 { TCERR_DQUOTE_IN_EXPR,
1328 "a double-quoted string (\"%~.*s\") is not valid within an expression",
1329 "The double-quoted string value (\"%~.*s\") cannot be used within an "
1330 "expression, because a double-quoted string has no value. A "
1331 "double-quoted string indicates that you simply want to display "
1332 "the text of the string. Change "
1333 "the string's quotes to single quotes (') if you meant to use the "
1334 "string as a value in an expression." },
1335
1336 { TCERR_ASI_IN_COND,
1337 "assignment in condition (possible use of '=' where '==' was intended)",
1338 "The condition expression contains an assignment. This frequently "
1339 "indicates that the '=' (assignment) operator was used where the "
1340 "'==' (equality comparison) operator was intended. Check the condition "
1341 "to ensure that an assignment was actually intended. If the assignment "
1342 "is intentional, you can remove this warning by modifying the "
1343 "condition expression from the current form (x = y) to the form "
1344 "((x = y) != nil) or ((x = y) != 0) as appropriate, which will not "
1345 "change the meaning but will make it clear that the assignment is "
1346 "intentional." },
1347
1348 { TCERR_REPFUNC_UNDEF,
1349 "\"replace\"/\"modify\" cannot be used with a function not "
1350 "previously defined",
1351 "The \"replace\" and \"modify\" keywords cannot be used with a function "
1352 "that is not previously defined. The function must at least be defined "
1353 "as an \"extern\" function before it can be replaced." },
1354
1355 { TCERR_REPLACE_PROP_REQ_MOD_OBJ,
1356 "\"replace\" can be used with a property only in a \"modify\" object",
1357 "The \"replace\" keyword can be used with a property only in an "
1358 "object defined with the \"modify\" keyword. This object is not "
1359 "defined with \"modify\", so \"replace\" is not allowed with its "
1360 "property definitions." },
1361
1362 { TCERR_EXTERN_OBJ_REQ_SYM,
1363 "expected object name symbol in \"extern\" statement but found \"%~.*s\"",
1364 "An object name symbol is required after \"extern object\" or "
1365 "\"extern class\", but the compiler found \"%~.*s\". Check the syntax "
1366 "and supply the missing object name." },
1367
1368 { TCERR_PROP_REDEF_IN_OBJ,
1369 "property \"%~.*s\" already defined in object",
1370 "The property \"%~.*s\" is already defined in this object. An "
1371 "object can have at most one definition for a given property. Remove "
1372 "the redundant property definition." },
1373
1374 { TCERR_PROP_REQ_EQ,
1375 "'=' required between property name and value - found \"%~.*s\"",
1376 "An equals sign '=' is required to separate the property name and "
1377 "its value; the parser found \"%~.*s\" where the '=' should go. "
1378 "Check the syntax and supply the missing '='." },
1379
1380 { TCERR_LIST_EXPECT_ELEMENT,
1381 "extra list element expected after comma, but found end of list",
1382 "An additional list element was expected after the last comma in the "
1383 "list, but the compiler found the end of the list (a closing bracket "
1384 "']') instead. Check the list and either remove the unnecessary "
1385 "extra comma or add the missing list element." },
1386
1387 { TCERR_REQ_INTRINS_CLASS_NAME,
1388 "expected class name string after class name symbol, but found \"%~.*s\"",
1389 "The \"intrinsic class\" name must be followed by the global name "
1390 "of the metaclass, enclosed in single-quotes, but the compiler found "
1391 "\"%~.*s\" instead. Check the statement syntax." },
1392
1393 { TCERR_REQ_INTRINS_CLASS_LBRACE,
1394 "expected '{' after intrinsic class name, but found \"%~.*s\"",
1395 "The property listing for an \"intrinsic class\" statement must be "
1396 "closed in braces '{ }'. The compiler found \"%~.*s\" after the "
1397 "metaclass name, where the open brace '{' should be. Check the "
1398 "syntax." },
1399
1400 { TCERR_EOF_IN_INTRINS_CLASS,
1401 "end of file in \"intrinsic class\" list - '}' is probably missing",
1402 "The compiler reached the end of the file while still scanning "
1403 "an \"intrinsic class\" statement's property listing. The closing "
1404 "brace '}' of the list is probably missing; check "
1405 "for the missing brace." },
1406
1407 { TCERR_REQ_INTRINS_CLASS_PROP,
1408 "expected property name in intrinsic class list, but found \"%~.*s\"",
1409 "The compiler expected the name of a property in the intrinsic "
1410 "class property list, but found \"%~.*s\" instead. Check the syntax of "
1411 "the statement, and check for unbalanced braces." },
1412
1413 { TCERR_REQ_INTRINS_CLASS_NAME_SYM,
1414 "expected class name symbol after \"intrinsic class\", "
1415 "but found \"%~.*s\"",
1416 "The \"intrinsic class\" keywords must be followed by the class "
1417 "name symbol, but the compiler found \"%~.*s\" instead. Check "
1418 "the statement syntax." },
1419
1420 { TCERR_REDEF_INTRINS_NAME,
1421 "symbol \"%~.*s\" is already defined - can't redefine as intrinsic class",
1422 "The symbol \"%~.*s\" is already defined, so you cannot use it as "
1423 "the name of this intrinsic class. The symbol is already being "
1424 "used as the name of an object, function, or property elsewhere "
1425 "in the program. Change the name to a unique symbol." },
1426
1427 { TCERR_CANNOT_EVAL_METACLASS,
1428 "\"%~.*s\" is an intrinsic class name and cannot be evaluated "
1429 "in an expression",
1430 "The symbol \"%~.*s\" is an intrinsic class name. This symbol cannot "
1431 "be evaluated in an expression, because it has no value. You can "
1432 "only use this symbol in specific contexts where class names "
1433 "are permitted, such as with 'new'." },
1434
1435 { TCERR_DICT_SYNTAX,
1436 "expected 'property' or object name after 'dictionary', "
1437 "but found \"%~.*s\"",
1438 "The keyword 'property' or an object name symbol must follow "
1439 "the 'dictionary' keyword, but the compiler found \"%~.*s\" instead. "
1440 "Check the 'dictionary' statement syntax." },
1441
1442 { TCERR_DICT_PROP_REQ_SYM,
1443 "expected property name in 'dictionary property' list, but "
1444 "found \"%~.*s\"",
1445 "The name of a property was expected in the 'dictionary property' "
1446 "list, but the compiler found \"%~.*s\" instead. Check the "
1447 "statement syntax." },
1448
1449 { TCERR_DICT_PROP_REQ_COMMA,
1450 "expected comma in 'dictionary property' list, but found \"%~.*s\"",
1451 "A comma was expected after a property name symbol in a "
1452 "'dictionary property' list, but the compiler found \"%~.*s\" "
1453 "instead. Check the syntax of the property list and ensure that "
1454 "each item is separated from the next by a comma, and that the "
1455 "list ends with a semicolon." },
1456
1457 { TCERR_REDEF_AS_DICT,
1458 "redefining symbol \"%~.*s\" as dictionary object",
1459 "The symbol \"%~.*s\" cannot be used as a dictionary object, because "
1460 "it is already defined as a different type of object. You must change "
1461 "the name of this dictionary object, or change the name of the "
1462 "conflicting object definition." },
1463
1464 { TCERR_UNDEF_SYM_SC,
1465 "undefined symbol \"%~.*s\" (used as superclass of \"%~.*s\")",
1466 "The symbol \"%~.*s\" is undefined. This symbol is used as a superclass "
1467 "in the definition of the object \"%~.*s\". Check the object definition "
1468 "to ensure that the superclass name is spelled correctly, and check "
1469 "that the superclass's object definition is correct." },
1470
1471 { TCERR_VOCAB_REQ_SSTR,
1472 "vocabulary property requires string value, but found \"%~.*s\"",
1473 "A vocabulary property value must be one or more single-quoted "
1474 "string values, but the compiler found \"%~.*s\" instead. Check the "
1475 "property definition and use a single-quoted string value." },
1476
1477 { TCERR_VOCAB_NO_DICT,
1478 "vocabulary property cannot be defined - no dictionary is active",
1479 "A vocabulary property cannot be defined for this object because "
1480 "no dictionary is active. Insert a 'dictionary' statement prior "
1481 "to this object definition to establish the dictionary object that "
1482 "will be used to store this object's vocabulary." },
1483
1484 { TCERR_LISTPAR_NOT_LAST,
1485 "variable-argument list parameter must be the last parameter",
1486 "A variable-argument list parameter (a parameter enclosed in square "
1487 "brackets '[ ]') is required to be the last parameter in the "
1488 "parameter list. Remove the parameters following the list parameter." },
1489
1490 { TCERR_LISTPAR_REQ_RBRACK,
1491 "expected ']' after variable-argument list parameter, but found \"%~.*s\"",
1492 "A closing square bracket ']' was expected following the "
1493 "variable-argument list parameter name, but the compiler found "
1494 "\"%~.*s\" instead. Insert the missing bracket." },
1495
1496 { TCERR_LISTPAR_REQ_SYM,
1497 "variable-argument list parameter name expected, but found \"%~.*s\"",
1498 "A parameter name symbol was expected after the left square bracket '[', "
1499 "but the compiler found \"%~.*s\" instead. Check the syntax." },
1500
1501 { TCERR_DBG_NO_ANON_FUNC,
1502 "anonymous functions are not allowed in the debugger",
1503 "Anonymous functions are not allowed in the debugger." },
1504
1505 { TCERR_ANON_FUNC_REQ_NEW,
1506 "anonymous function requires 'new' before 'function' keyword",
1507 "An anonymous function definition requires the keyword 'new' "
1508 "before the keyword 'function'. This definition does not contain "
1509 "the 'new' keyword. Insert 'new' before 'function' in the "
1510 "definition." },
1511
1512 { TCERR_GRAMMAR_REQ_SYM,
1513 "expected symbol name after 'grammar', but found \"%~.*s\"",
1514 "A symbol giving the name of a production is required after "
1515 "the 'grammar' keyword, but the compiler found \"%~.*s\" instead. "
1516 "Check the statement syntax." },
1517
1518 { TCERR_GRAMMAR_REQ_COLON,
1519 "expected ':' after production name, but found \"%~.*s\"",
1520 "A colon ':' is required after the name of the production in "
1521 "a 'grammar' statement, but the compiler found \"%~.*s\" instead. "
1522 "Check the statement syntax and insert the missing colon." },
1523
1524 { TCERR_GRAMMAR_REQ_OBJ_OR_PROP,
1525 "object or property symbol required in 'grammar' token list "
1526 "(found \"%~.*s\")",
1527 "Symbols used in a token list in a 'grammar' statement must "
1528 "be property or object names. The symbol \"%~.*s\" is not a "
1529 "property or object name, so it cannot be used in the token list. "
1530 "Remove this symbol from the list or replace it with a symbol "
1531 "of the appropriate type." },
1532
1533 { TCERR_GRAMMAR_ARROW_REQ_PROP,
1534 "'->' in 'grammar' token list must be followed by a property name "
1535 "(found \"%~.*s\")",
1536 "An arrow '->' in a 'grammar' statement's token list must be "
1537 "followed by a property name, but the compiler found \"%~.*s\" "
1538 "instead. Check the statement syntax." },
1539
1540 { TCERR_GRAMMAR_INVAL_TOK,
1541 "invalid token \"%~.*s\" in 'grammar' token list",
1542 "The token \"%~.*s\" is not valid in a 'grammar' statement's token "
1543 "list. The token list must consist of property names, object names, "
1544 "and literal strings (in single quotes). Check the statement syntax." },
1545
1546 { TCERR_REDEF_AS_GRAMPROD,
1547 "redefining symbol \"%~.*s\" as grammar production object",
1548 "The symbol \"%~.*s\" cannot be used as a grammar production, because "
1549 "it is already defined as a different type of object. You must change "
1550 "the name of this production object, or change the name of the "
1551 "conflicting object definition." },
1552
1553 { TCERR_GRAMMAR_REQ_PROD,
1554 "object \"%~.*s\" is not valid in a grammar rule - only production "
1555 "names are allowed",
1556 "The object \"%~.*s\" cannot be used in a grammar rule. Only "
1557 "production names are allowed. A production name is a symbol "
1558 "that is used immediately after the 'grammar' keyword in a "
1559 "grammar rule definition." },
1560
1561 { TCERR_ENUM_REQ_SYM,
1562 "symbol expected in 'enum' list - found \"%~.*s\"",
1563 "A symbol name was expected in the 'enum' statement's list of "
1564 "enumerator symbols to define, but the compiler found \"%~.*s\" "
1565 "instead. Check the statement syntax." },
1566
1567 { TCERR_REDEF_AS_ENUM,
1568 "symbol \"%~.*s\" is already defined - can't be used as an enum name",
1569 "The symbol \"%~.*s\" is already defined, so it can't be used as an "
1570 "'enum' name. An 'enum' name cannot be used for any other global "
1571 "symbol, such as an object, function, or property name. Change the "
1572 "enum name, or change the conflicting symbol definition." },
1573
1574 { TCERR_ENUM_REQ_COMMA,
1575 "comma expected in 'enum' symbol list, but found \"%~.*s\"",
1576 "A comma was expected after a symbol name in the 'enum' statement's "
1577 "list of enumerator symbols, but the compiler found \"%~.*s\" "
1578 "instead. Check the statement syntax and insert the missing "
1579 "comma." },
1580
1581 { TCERR_GRAMMAR_BAD_ENUM,
1582 "enumerator \"%~.*s\" in 'grammar' list is not declared with "
1583 "'enum token'",
1584 "The enumerator \"%~.*s\" in the 'grammar' list was not originally "
1585 "declared with 'enum token'. Only 'enum token' enumerators can be "
1586 "used in 'grammar' token lists. Check the original definition of "
1587 "the enumerator and change it to 'enum token', or remove the "
1588 "enumerator from this 'grammar' list." },
1589
1590 { TCERR_GRAMMAR_STAR_NOT_END,
1591 "'*' must be the last token in a 'grammar' alternative list "
1592 "(found \"%~.*s\")",
1593 "A '*' must be the last token in a 'grammar' alternative list, "
1594 "because this specifies a match for any remaining input tokens. "
1595 "The compiler found \"%~.*s\" after the '*'. Check the grammar "
1596 "definition, and end the alternative immediately after the '*'." },
1597
1598 { TCERR_GRAMMAR_QUAL_NOT_FIRST,
1599 "grammar qualifiers must precede all tokens",
1600 "Grammar qualifiers (sequences enclosed in square brackets '[ ]' "
1601 "within a 'grammar' statement's item list) must precede all "
1602 "token items in an alternative. This statement contains a qualifier "
1603 "that appears after one or more token items. Move the qualifier "
1604 "to the start of the alternative's token list." },
1605
1606 { TCERR_GRAMMAR_QUAL_REQ_SYM,
1607 "keyword required after '[' in grammar qualifier - found \"%~.*s\"",
1608 "A keyword is required after the open bracket '[' in a grammar "
1609 "qualifier, but the compiler found \"%~.*s\" instead. The keyword "
1610 "must specify a valid grammar qualifier." },
1611
1612 { TCERR_BAD_GRAMMAR_QUAL,
1613 "invalid grammar qualifier \"%~.*s\"",
1614 "The grammar qualifier \"%~.*s\" is not valid. Check the statement "
1615 "syntax." },
1616
1617 { TCERR_GRAMMAR_QUAL_REQ_INT,
1618 "grammar qualifier \"[%s]\" requires integer constant value",
1619 "The grammar qualifier \"[%s]\" requires an integer constant value. "
1620 "The expression is missing, invalid, or does not evaluate to a "
1621 "constant integer value. Check the qualifier syntax." },
1622
1623 { TCERR_GRAMMAR_QUAL_REQ_RBRACK,
1624 "']' required after grammar qualifier - found \"%~.*s\"",
1625 "A closing bracket ']' is required at the end of a grammar "
1626 "qualifier, but the compiler found \"%~.*s\" instead. Check the "
1627 "syntax, and add the missing ']' or remove extraneous extra text." },
1628
1629 { TCERR_PLUSPROP_REQ_SYM,
1630 "symbol expected after '+ property', but found \"%~.*s\" instead",
1631 "A property symbol is required for the '+ property' statement, but the "
1632 "compiler found \"%~.*s\" instead. Check the syntax." },
1633
1634 { TCERR_PLUSOBJ_TOO_MANY,
1635 "too many '+' signs in object definition - location not defined",
1636 "This object definition has too many '+' signs. The immediately "
1637 "preceding object is not at a deep enough containment level for "
1638 "this many '+' signs. Check the previous object's location "
1639 "definition. You might need to move the immediately preceding "
1640 "object definition so that it doesn't come between this object "
1641 "and the preceding container you wish to refer to." },
1642
1643 { TCERR_OBJ_TPL_OP_REQ_PROP,
1644 "property name required after \"%s\" in object template - found \"%~.*s\"",
1645 "A property name is required after the \"%s\" token in the 'object "
1646 "template' statement, but the compiler found \"%~.*s\" instead. Check "
1647 "the statement syntax." },
1648
1649 { TCERR_OBJ_TPL_STR_REQ_PROP,
1650 "property name required in object template string - found %~.*s",
1651 "The contents of each string in an 'object "
1652 "template' statement must be a property name symbol, but the compiler "
1653 "found %~.*s in a string instead. Check the statement syntax." },
1654
1655 { TCERR_OBJ_TPL_REQ_RBRACK,
1656 "expected ']' after object template property name - found \"%~.*s\"",
1657 "A matching right square bracket ']' is required after a list property "
1658 "name in an 'object template' statement, but the compiler found "
1659 "\"%~.*s\" instead. Check the statement syntax." },
1660
1661 { TCERR_OBJ_TPL_BAD_TOK,
1662 "unexpected token \"%~.*s\" in object template",
1663 "The token \"%~.*s\" is invalid in an 'object template' statement. "
1664 "Each entry in the statement must be a property name in single or "
1665 "double quotes or square brackets, or one of the allowed operators "
1666 "('@', '+', '-', etc) followed by a property name." },
1667
1668 { TCERR_OBJ_TPL_SYM_NOT_PROP,
1669 "symbol \"%~.*s\" in object template is not a property",
1670 "The symbol \"%~.*s\" is used in an 'object template' statement where "
1671 "a property is required, but the symbol is not a property. Check "
1672 "for conflicting usage of the symbol (as an object or function name, "
1673 "for example)." },
1674
1675 { TCERR_OBJ_DEF_NO_TEMPLATE,
1676 "object definition does not match any template",
1677 "This object definition appears to use template notation, but it doesn't "
1678 "match any defined object template. Check your 'object template' "
1679 "definitions to make sure this object syntax is defined, or correct "
1680 "this object definition to match one of the defined templates. If "
1681 "this object is not intended to use a template at all, the object's "
1682 "first property definition probably has a syntax error, so check "
1683 "the object's property list syntax." },
1684
1685 { TCERR_OBJ_TPL_NO_VOCAB,
1686 "property \"%~.*s\" is a dictionary property - not valid in templates",
1687 "Property \"%~.*s\" is a dictionary property, which cannot be used "
1688 "in an object template." },
1689
1690 { TCERR_OBJ_TPL_PROP_DUP,
1691 "property \"%~.*s\" duplicated in object template",
1692 "The property \"%~.*s\" appears more than once in this 'object template' "
1693 "list. A given property can be used only once in a template." },
1694
1695 { TCERR_META_ALREADY_DEF,
1696 "intrinsic class has been previously defined as \"%~.*s\"",
1697 "This same intrinsic class has been previously defined with "
1698 "the name \"%~.*s\". An intrinsic class may only be defined with "
1699 "one class symbol. Remove one of the conflicting definitions." },
1700
1701 { TCERR_OBJ_DEF_REQ_SEM,
1702 "missing semicolon at end of object definition - found \"%~.*s\"",
1703 "This object definition is missing its closing semicolon ';' - the "
1704 "compiler found \"%~.*s\", which the compiler must assume is the start "
1705 "of a new statement or object definition. Insert the missing "
1706 "semicolon. If this is actually meant to be part of the object "
1707 "definition, there is a syntax error here - check and correct the "
1708 "syntax." },
1709
1710 { TCERR_EXPECTED_STMT_START,
1711 "expected start of statement, but found \"%~.*s\"",
1712 "The compiler expected to find the beginning of a statement, "
1713 "but found \"%~.*s\" instead. Check the statement syntax; check "
1714 "for preceding strings that weren't properly terminated, or extra "
1715 "or missing braces." },
1716
1717 { TCERR_MISSING_COLON_FORMAL,
1718 "missing colon at end of anonymous function formal list - found \"%~.*s\"",
1719 "The short-form of the anonymous function definition requires a colon "
1720 "':' at the end of the formal parameter list, but the compiler "
1721 "found \"%~.*s\" instead. Even if the function has no arguments, it "
1722 "still requires a colon immediately following the open brace '{'. " },
1723
1724 { TCERR_SEM_IN_SHORT_ANON_FN,
1725 "semicolon is not allowed in a short anonymous function",
1726 "This short-form anonymous function contains a semicolon, which is "
1727 "not allowed. A short-form anonymous function must consist of "
1728 "a single expression, and is terminated with the closing brace '}' "
1729 "with no semicolon between the expression and the brace." },
1730
1731 { TCERR_SHORT_ANON_FN_REQ_RBRACE,
1732 "semicolon is not allowed in a short-form anonymous function",
1733 "This short-form anonymous function's expression is followed by a "
1734 "semicolon, which is not allowed. A short-form anonymous function "
1735 "can contain only an expression, and ends with a right brace '}'." },
1736
1737 { TCERR_SHORT_ANON_FN_REQ_RBRACE,
1738 "missing '}' at end of anonymous function expression - found \"%~.*s\"",
1739 "There is no right brace '}' at the end of this short-form "
1740 "anonymous function. A short-form anonymous function must contain "
1741 "only an expression and end with '}'. Check the syntax." },
1742
1743 { TCERR_IN_REQ_LPAR,
1744 "missing '(' after 'in' operator - found \"%~.*s\"",
1745 "An open parenthesis '(' is required after the 'in' operator, but "
1746 "the compiler found \"%~.*s\". Check the syntax and insert the "
1747 "missing parenthesis." },
1748
1749 { TCERR_EXPECTED_IN_COMMA,
1750 "expected ',' or ')' in 'in' list, but found \"%~.*s\"",
1751 "Expected a comma ',' or right parenthesis ')' in the 'in' list, "
1752 "but found \"%~.*s\". The expressions in an 'in' list must be "
1753 "separated by commas, and the entire list must be enclosed in "
1754 "parentheses '( )'. Check for errors and unbalanced parentheses "
1755 "in the argument expression." },
1756
1757 { TCERR_EXPECTED_IN_RPAR,
1758 "expected ')' at end of 'in' list, but found \"%~.*s\"",
1759 "Expected a right parenthesis ')' at the end of the 'in' list, "
1760 "but found \"%~.*s\". The compiler is assuming that this is the end "
1761 "of the statement. Please insert the missing parenthesis, or check "
1762 "the argument list for unbalanced parentheses or other errors." },
1763
1764 { TCERR_CANNOT_MOD_OR_REP_TYPE,
1765 "objects of this type cannot be modified or replaced",
1766 "You cannot use 'modify' or 'replace' with an object of this type. "
1767 "Only objects and classes originally defined as ordinary objects "
1768 "can be modified or replaced." },
1769
1770 { TCERR_REQ_FOREACH_LPAR,
1771 "expected '(' after \"foreach\", but found \"%~.*s\"",
1772 "An open parenthesis '(' is required after the \"foreach\" keyword, "
1773 "but the compiler found \"%~.*s\" instead. Check the syntax "
1774 "and insert the missing parenthesis." },
1775
1776 { TCERR_MISSING_FOREACH_EXPR,
1777 "missing expression in \"foreach\" - found \"%~.*s\"",
1778 "This \"foreach\" statement is missing its iteration expression; "
1779 "the compiler found \"%~.*s\" when it was expecting the iteration "
1780 "expression of the form 'x in <collectionExpression>'. Check the "
1781 "syntax." },
1782
1783 { TCERR_FOREACH_REQ_IN,
1784 "\"in\" required in \"foreach\" - found \"%~.*s\"",
1785 "The keyword \"in\" was expected after the iteration variable "
1786 "expression in the this \"foreach\" statement, but the compiler "
1787 "found \"%~.*s\" instead. Check the syntax." },
1788
1789 { TCERR_REQ_FOREACH_RPAR,
1790 "missing ')' at end of \"foreach\" expression - found \"%~.*s\"",
1791 "A closing parenthesis ')' is required at the end of the \"foreach\" "
1792 "statement's expression, but the compiler found \"%~.*s\" instead. "
1793 "Check the syntax, and insert the missing parenthesis, or correct "
1794 "unbalanced parentheses or other syntax errors earlier in the "
1795 "expression." },
1796
1797 { TCERR_PROPDECL_REQ_SYM,
1798 "expected property name in 'property' list, but found \"%~.*s\"",
1799 "The name of a property was expected in the 'property' "
1800 "list, but the compiler found \"%~.*s\" instead. Check the "
1801 "statement syntax." },
1802
1803 { TCERR_PROPDECL_REQ_COMMA,
1804 "expected comma in 'property' list, but found \"%~.*s\"",
1805 "A comma was expected after a property name symbol in a "
1806 "'property' list, but the compiler found \"%~.*s\" "
1807 "instead. Check the syntax of the list and ensure that "
1808 "each item is separated from the next by a comma, and that the "
1809 "list ends with a semicolon." },
1810
1811 { TCERR_EXPORT_REQ_SYM,
1812 "expected symbol in 'export' statement, but found \"%~.*s\"",
1813 "A symbol name must follow the 'export' keyword, but the compiler "
1814 "found \"%~.*s\" instead. Check the syntax of the statement." },
1815
1816 { TCERR_EXPORT_EXT_TOO_LONG,
1817 "external name \"%~.*s\" in 'export' is too long",
1818 "The external name \"%~.*s\" in this 'export' statement is too long. "
1819 "External names are limited to the same maximum length as regular "
1820 "symbol names." },
1821
1822 { TCERR_UNTERM_OBJ_DEF,
1823 "unterminated object definition",
1824 "This object definition is not properly terminated - a semicolon ';' or "
1825 "closing brace '}' should appear at the end of the definition. The "
1826 "compiler found a new object definition or a statement that cannot "
1827 "be part of an object definition, but did not find the end of the "
1828 "current object definition. Insert the appropriate terminator, or "
1829 "check the syntax of the property definition. Note that this error "
1830 "is normally reported at the END of the unterminated object, so if "
1831 "the line number of the error refers to the start of a new object, "
1832 "it's probably the preceding object that is not property terminated." },
1833
1834 { TCERR_OBJ_DEF_REQ_RBRACE,
1835 "missing right brace at end of object definition - found \"%~.*s\"",
1836 "This object definition is missing its closing brace '}' - the "
1837 "compiler found \"%~.*s\", which the compiler must assume is the start "
1838 "of a new statement or object definition. Insert the missing "
1839 "brace. If this is actually meant to be part of the object "
1840 "definition, there is a syntax error here - check and correct the "
1841 "syntax." },
1842
1843 { TCERR_GRAMMAR_REQ_NAME_RPAR,
1844 "missing right parenthesis after name in 'grammar' - found \"%~.*s\"",
1845 "A right parenthesis ')' is required after the name tag in a 'grammar' "
1846 "statement, but the compiler found \"%~.*s\". Check the syntax and "
1847 "insert the missing parenthesis." },
1848
1849 { TCERR_PROPSET_REQ_LBRACE,
1850 "missing open brace '{' in propertyset definition - found \"%~.*s\"",
1851 "An open brace '{' is required to group the properties in the "
1852 "propertyset definition. The compiler found \"%~.*s\" where the "
1853 "open brace should be. Check the syntax and remove any extraneous "
1854 "characters or insert the missing open brace, as appropriate." },
1855
1856 { TCERR_GRAMMAR_REQ_RPAR_AFTER_GROUP,
1857 "missing right parentheses after group in 'grammar' - found \"%~.*s\"",
1858 "A right parenthesis ')' is required at the end of a parenthesized "
1859 "token group in a 'grammar' statement, but the compiler found "
1860 "\"%~.*s\". Check the syntax and insert the missing parenthesis." },
1861
1862 { TCERR_GRAMMAR_GROUP_ARROW_NOT_ALLOWED,
1863 "'->' is not allowed after parenthesized group in 'grammar' statement",
1864 "The arrow operator '->' is not allowed after a parenthesized group "
1865 "in a 'grammar' statement. A group is not a true sub-production, so "
1866 "it has no match object to assign to a property. If you want to "
1867 "create a run-time match object for the group, make the group into "
1868 "a rule for a separate, named production, and use the name of the "
1869 "production instead of the group in this rule." },
1870
1871 { TCERR_OBJ_DEF_CANNOT_USE_TEMPLATE,
1872 "cannot use template with an unimported extern class as superclass",
1873 "This object cannot be defined with template notation (property value "
1874 "constants immediately after the superclass name or names) because "
1875 "one or more of its superclasses are unimported 'extern' classes, or "
1876 "inherit from unimported extern classes. The compiler does not have "
1877 "any class relationship information about classes that are explicitly "
1878 "defined as external ('extern') and not imported from a symbol file "
1879 "that is part of the current build, so it cannot determine which "
1880 "class's template definition to use. You must define this object's "
1881 "properties using the normal 'name = value' notation rather than "
1882 "using a template." },
1883
1884 { TCERR_REPLACE_OBJ_REQ_SC,
1885 "base class list required for object 'replace' definition",
1886 "This 'replace' statement replaces an object with a new definition, "
1887 "but it does not have a superclass list. A superclass list is "
1888 "required for the replacement object definition." },
1889
1890 { TCERR_PROPSET_TOO_DEEP,
1891 "'propertyset' nesting is too deep",
1892 "This 'propertyset' definition is too deeply nested - it's inside "
1893 "too many other 'propertyset' definitions. You must reduce "
1894 "the nesting depth." },
1895
1896 { TCERR_PROPSET_TOK_TOO_LONG,
1897 "expanded property name in propertyset is too long",
1898 "This property name, expanded into its full name using the "
1899 "propertyset pattern string, is too long. You must shorten the "
1900 "fully expanded name by shortening the propertyset pattern, "
1901 "shortening this property's name, or reducing the propertyset "
1902 "nesting depth." },
1903
1904 { TCERR_PROPSET_INVAL_PAT,
1905 "propertyset pattern string \"%~.*s\" is invalid",
1906 "The propertyset pattern string \"%~.*s\" is not valid. A propertyset "
1907 "pattern string must consist of valid symbol characters plus "
1908 "exactly one asterisk '*' (which specifies where the property "
1909 "names within the propertyset are inserted into the pattern)." },
1910
1911 { TCERR_PROPSET_INVAL_FORMALS,
1912 "invalid formal parameters in propertyset definition",
1913 "The propertyset formal parameter list is invalid. The parameters "
1914 "must contain exactly one asterisk '*', specifying the argument "
1915 "position where additional per-property parameters are inserted "
1916 "into the common parameter list." },
1917
1918 { TCERR_CIRCULAR_CLASS_DEF,
1919 "circular class definition: %~.*s is a subclass of %~.*s",
1920 "This class is defined circularly: %~.*s is a subclass of %~.*s, "
1921 "so the latter cannot also be a subclass of the former. Check the "
1922 "definition of the base class. " },
1923
1924 { TCERR_GRAMMAR_LIST_REQ_PROP,
1925 "property name required in list in 'grammar', but found \"%~.*s\"",
1926 "A part-of-speech list within a 'grammar' rule definition is only "
1927 "allowed to contain property names, but the compiler found \"%~.*s\" "
1928 "instead. Check the syntax. " },
1929
1930 { TCERR_GRAMMAR_LIST_UNCLOSED,
1931 "missing '>' in 'grammar' property list - found \"%~.*s\"",
1932 "The grammar property list is missing the closing angle bracket '>'; "
1933 "the compiler found \"%~.*s\" in the list and will assume that the '>' "
1934 "was accidentally omitted. Insert the missing '>' or remove the "
1935 "extraneous text from the list. " },
1936
1937 { TCERR_CONST_IDX_INV_TYPE,
1938 "invalid indexed type in constant expression - list required",
1939 "Only a list value can be indexed in a constant expression. The "
1940 "constant value being indexed in this expression is not a list. " },
1941
1942 { TCERR_INVAL_TRANSIENT,
1943 "'transient' is not allowed here",
1944 "The 'transient' keyword is not allowed in this context. 'transient' "
1945 "can only be used to modify an object definition; it cannot be used "
1946 "with classes, functions, templates, or any other definitions. " },
1947
1948 { TCERR_GRAMMAR_MOD_REQ_TAG,
1949 "'modify/replace grammar' requires name-tag",
1950 "'modify grammar' and 'replace grammar' can only be used with a grammar "
1951 "rule that includes a name-tag (in parentheses after the production "
1952 "name). The name-tag must match a grammar rule defined previously. " },
1953
1954 { TCERR_REQ_INTRINS_SUPERCLASS_NAME,
1955 "expected intrinsic superclass name after colon, but found \"%~.*s\"",
1956 "The name of the intrinsic class's superclass was expected after "
1957 "the colon, but the compiler found \"%~.*s\" instead. Add the "
1958 "superclass name (or remove the colon). " },
1959
1960 { TCERR_INTRINS_SUPERCLASS_UNDEF,
1961 "intrinsic class superclass \"%~.*s\" is not defined",
1962 "The intrinsic class superclass \"%~.*s\" is not defined. You must "
1963 "define the superclass before you define any subclasses. " },
1964
1965 { TCERR_GRAMMAR_ENDS_WITH_OR,
1966 "grammar rule ends with '|' (add '()' if empty last rule is "
1967 "intentional)",
1968 "The grammar rule ends with '|'. This indicates that the rule matches "
1969 "a completely empty input. This is legal, but it's uncommon. "
1970 "If you really intend for this rule to match empty input, "
1971 "you can eliminate this warning by making the empty rule "
1972 "explicit, by using '()' for the empty match rule. " },
1973
1974 { TCERR_GRAMMAR_EMPTY,
1975 "grammar rule is empty (add '()' if this is intentional)",
1976 "The grammar rule is empty, which indicates that the rule matches "
1977 "a completely empty input. This is legal, but it's uncommon. "
1978 "If you really intend for this rule to match empty input, "
1979 "you can eliminate this warning by making the empty rule "
1980 "explicit, by using '()' for the empty match rule. " },
1981
1982 { TCERR_TEMPLATE_EMPTY,
1983 "empty template definition",
1984 "The template is empty. A template definition must include at "
1985 "least one property name." },
1986
1987 { TCERR_REQ_RPAR_IF,
1988 "expected ')' after the \"if\" condition, but found \"%~.*s\"",
1989 "A close parenthesis ')' is required after the condition expression "
1990 "in the \"if\" statement, to balance the required open parenthesis, "
1991 "but the compiler found \"%~.*s\" instead. The compiler will assume "
1992 "that a parenthesis was intended. Please correct the syntax "
1993 "by inserting a parenthesis." },
1994
1995 { TCERR_INTRINS_SUPERCLASS_NOT_INTRINS,
1996 "intrinsic class superclass \"%~.*s\" is not an intrinsic class",
1997 "The intrinsic class superclass \"%~.*s\" is not itself an intrinsic "
1998 "class. An intrinsic class can only be derived from another intrinsic "
1999 "class. " },
2000
2001 { TCERR_FUNC_REDEF_AS_MULTIMETHOD,
2002 "function \"%.*s\" is already defined - can't redefine as a multi-method",
2003 "The function \"%.*s\" is already defined as an ordinary function, "
2004 "so it can't be redefined here with typed parameters. If you intended "
2005 "for the original version to be a multi-method, add the 'multimethod' "
2006 "modifier to its definition, immediately after the closing parenthesis "
2007 "of the parameter list in the function definition, as in "
2008 "\"foo(x) multimethod { ... }\"." },
2009
2010 { TCERR_MULTIMETHOD_NOT_ALLOWED,
2011 "'multimethod' is not allowed here",
2012 "The 'multimethod' modifier is not allowed in this context. "
2013 "This modifier can only be used for top-level function definitions." },
2014
2015 { TCERR_MMPARAM_NOT_OBJECT,
2016 "parameter type \"%~.*s\" is not an object",
2017 "The declared parameter type \"%~.*s\" is not an object. Only object "
2018 "or class names can be used to declare parameter types. Check the "
2019 "definition of the function and make sure the type name is correct, "
2020 "and that the same name isn't used elsewhere as a non-object type." },
2021
2022 { TCERR_MMINH_MISSING_ARG_TYPE,
2023 "expected a type name in inherited<> type list, but found \"%~.*s\"",
2024 "An inherited<> type list requires a type name (a class or object "
2025 "name, or '*' or '...') in each position. The compiler found "
2026 "\"%~.*s\" where it expected to find a type. The type must be "
2027 "written as a simple name, with no parentheses or other punctuation." },
2028
2029 { TCERR_MMINH_MISSING_COMMA,
2030 "expected a comma in inherited<> type list, but found \"%~.*s\"",
2031 "The compiler found \"%~.*s\" where it expected to find a comma "
2032 "in an inherited<> type list. Each element in the list must be "
2033 "separated by a comma." },
2034
2035 { TCERR_MMINH_MISSING_GT,
2036 "missing '>' in inherited<> type list (found \"%~.*s\")",
2037 "An inherited<> type list must end with a '>'. The compiler "
2038 "found \"%~.*s\", and is assuming that the list ends here. If "
2039 "this isn't the end of the type list, check the syntax; otherwise, "
2040 "just add '>' at the end of the list." },
2041
2042 { TCERR_MMINH_MISSING_ARG_LIST,
2043 "argument list missing in inherited<> (expected '(', found \"%~.*s\")",
2044 "An inherited<> expression requires an argument list. The compiler "
2045 "found \"%~.*s\" it expected the opening '(' of the argument list. "
2046 "If the function doesn't take any arguments, use empty parentheses, "
2047 "'()', to indicate the empty argument list." },
2048
2049 { TCERR_NAMED_ARG_NO_ELLIPSIS,
2050 "a pass-by-name argument value cannot use an ellipsis '...'",
2051 "A named argument value (\"name: expression\") cannot be combined "
2052 "with an ellipsis '...'. The ellipsis expands a list value into "
2053 "a series of positional arguments. This isn't meaningful with a "
2054 "named argument, because a named argument is passed by name rather "
2055 "than by position." },
2056
2057 { TCERR_ARG_MUST_BE_OPT,
2058 "parameter '%.*s' must be optional because it follows an "
2059 "optional parameter",
2060 "The parameter variable '%.*s' in this function or method definition "
2061 "must be declared as optional, because it follows one or more other "
2062 "optional arguments in the list. Argument values are assigned to parameter "
2063 "names in left-to-right order at run-time, so once you have one optional "
2064 "parameter to the list, all of the parameters that follow it must be "
2065 "optional as well. You can make this parameter optional by adding "
2066 "a '?' suffix after the variable name, or by adding an '= expression' "
2067 "default value expression after the name." },
2068
2069 { TCERR_NAMED_ARG_NO_TYPE,
2070 "formal parameter '%.*s' is named - a type declaration isn't allowed",
2071 "The formal parameter '%.*s' is named (it uses a ':' suffix), so it "
2072 "can't have a type declaration. Multimethod selection is based "
2073 "strictly on the positional arguments; named parameters aren't "
2074 "used in the selection process, so they can't be declared with types." },
2075
2076 { TCERR_LOOKUP_LIST_EXPECTED_ARROW,
2077 "missing -> in %dth element in LookupTable list",
2078 "An arrow '->' was expected in the %dth element of the LookupTable "
2079 "list. This list appears to be a LookupTable list, because earlier "
2080 "elements use the Key->Value notation, so every element must given "
2081 "as a Key->Value pair." },
2082
2083 { TCERR_ARROW_IN_LIST,
2084 "unexpected -> found in list (after %dth element)",
2085 "An arrow '->' was found in a list expression, after the %dth element. "
2086 "The arrow isn't allowed here because the expression appears to be an "
2087 "ordinary list, not a LookupTable list. If you intended this to be "
2088 "a LookupTable list, every element must be given as a Key->Value pair." },
2089
2090 { TCERR_MISPLACED_ARROW_IN_LIST,
2091 "misplaced -> in LookupTable list after %dth element - expected comma",
2092 "A comma ',' should appear after the %dth element of the LookupTable "
2093 "list, but an arrow '->' was found instead. The arrow appears to be "
2094 "misplaced. Each Key->Value pair in a LookupTable list should be "
2095 "separated from the next by a comma." },
2096
2097 { TCERR_LOOKUP_LIST_EXPECTED_END_AT_DEF,
2098 "LookupTable list must end after default *-> value, but found \"%~.*s\"",
2099 "A LookupTable list must end after the default value (specified with "
2100 "\"*->Value\"), but the compiler found \"%~.*s\" where the closing "
2101 "bracket ']' should be. Rearrange the list so that the default "
2102 "value is in the final position in the list." },
2103
2104 { TCERR_OPER_IN_PROPSET,
2105 "an 'operator' property cannot be defined within a 'propertyset'",
2106 "An 'operator' property cannot be defined within a 'propertyset' "
2107 "group. You must move the 'operator' property definition outside "
2108 "of the group." },
2109
2110 { TCERR_EXPECTED_RBRACK_IN_OP,
2111 "expected ']' in 'operator []', found '%~.*s'",
2112 "The ']' in an 'operator []' property declaration was missing (the "
2113 "compiler found '%~.*s' where the ']' should go)." },
2114
2115 { TCERR_BAD_OP_OVERLOAD,
2116 "invalid overloaded operator '%~.*s'",
2117 "The 'operator' property type requires one of the overloadable "
2118 "operators, but the compiler found '%~.*s' where the operator "
2119 "should appear. You must specify one of the overloadable operator "
2120 "symbols: + - * / % ^ << >> ~ | & [] []=" },
2121
2122 { TCERR_OP_OVERLOAD_WRONG_FORMALS,
2123 "wrong number of parameters defined for overloaded operator (%d required)",
2124 "This 'operator' property has the wrong number of parameters. "
2125 "This overloaded operator requires %d parameter(s)." },
2126
2127 { TCERR_RT_CANNOT_DEFINE_GLOBALS,
2128 "new global symbols (\"%~.*s\") cannot be defined in "
2129 "run-time code compilation",
2130 "Code compiled during program execution cannot define new global "
2131 "symbols. The code being compiled attempted to define \"%~.*s\"." },
2132
2133 { TCERR_FOR_IN_NOT_LOCAL,
2134 "'for..in' variable %.*s is not defined as a local variable",
2135 "The variable \"%.*s\" is being used as the control variable "
2136 "of a 'for..in' statement, but this variable isn't defined as a "
2137 "local variable. Check that the variable name is correct. If so, "
2138 "you must add a 'local' statement defining this variable (or simply "
2139 "add the word 'local' before the variable name in the 'in' clause)." },
2140
2141 { TCERR_BAD_EMBED_END_TOK,
2142 "<<%.*s>> found in string without a matching %s",
2143 "The compiler found the embedded keyword <<%.*s>> in this string, "
2144 "but this wasn't preceded by a matching %s. Check that all "
2145 "keywords are present and spelled correctly. If you're using nested "
2146 "<<if>>'s or the like, the problem might be that the begin/end "
2147 "aren't balanced properly for one of the nested levels." },
2148
2149 { TCERR_STRTPL_MISSING_LANGLE,
2150 "expected '<<' at start of string template, but found '%.*s'",
2151 "The compiler expected to find '<<' at the start of the string "
2152 "template definition (after the word 'template'), but found '%.*s'. "
2153 "Check the syntax, and insert the missing '<<'." },
2154
2155 { TCERR_STRTPL_MISSING_RANGLE,
2156 "expected '>>' at end of string template, but found '%.*s'",
2157 "The compiler expected to find '>>' at the end of the string "
2158 "template definition, but found '%.*s'. This symbol isn't allowed "
2159 "within a string template, so the compiler is guessing that this "
2160 "is really the end of the statement and that the template is missing "
2161 "its closing '>>'. Check the syntax. If you really meant to include "
2162 "this symbol in the template, you must change it to something else, "
2163 "since it's not an allowed template element. If you simply left off "
2164 "the closing '>>', add it at the end of the definition." },
2165
2166 { TCERR_STRTPL_MULTI_STAR,
2167 "only one '*' is allowed in a string template",
2168 "This string template definition has more than one '*' symbol. "
2169 "Only one '*' is allowed in a string template." },
2170
2171 { TCERR_STRTPL_FUNC_MISMATCH,
2172 "string template processor function %.*s() does not match template - "
2173 "must take %d parameter(s) and return a value",
2174 "The processor function %.*s() for this string template does not "
2175 "match the template usage. It must be defined as a function taking "
2176 "%d argument(s) and returning a value." },
2177
2178 { TCERR_DEFINED_SYNTAX,
2179 "invalid syntax for defined() operator - argument must be a symbol name",
2180 "The syntax for the defined() operator is invalid. This operator "
2181 "requires a single symbol name as the argument, in parentheses." },
2182
2183 { TCERR___OBJREF_SYNTAX,
2184 "invalid syntax for __objref() operator",
2185 "The syntax for the __objref() operator is invalid. This operator "
2186 "requires syntax of the form __objref(symbol) or __objref(symbol, mode), "
2187 "where the mode is 'warn' or 'error'." },
2188
2189 { TCERR_BAD_OP_FOR_FLOAT,
2190 "floating point values can't be used with this operator",
2191 "Floating point values can't be used with this operator. Only ordinary "
2192 "integer values can be used." },
2193
2194 { TCERR_INLINE_OBJ_REQ_LBRACE,
2195 "expected inline object property list starting with '{' (found '%.*s')",
2196 "An inline property definition must contain a property list enclosed "
2197 "in braces, '{ ... }'. The compiler found '%.*s' where it expected "
2198 "to see the left brace '{' at the start of the property list. Check "
2199 "the object definition syntax." },
2200
2201 { TCERR_CODEGEN_NO_MEM,
2202 "out of memory for code generation",
2203 "Out of memory. The compiler cannot allocate memory to generate "
2204 "the compiled code for the program. Make more memory available, "
2205 "if possible (by closing other applications, for example), then "
2206 "try running the compiler again." },
2207
2208 { TCERR_UNRES_TMP_FIXUP,
2209 "%d unresolved branches",
2210 "%d unresolved branches." },
2211
2212 { TCERR_WRITEAT_PAST_END,
2213 "attempting to write past end of code stream",
2214 "The compiler's code generator is attempting to "
2215 "write past the end of the code stream." },
2216
2217 { TCERR_SELF_NOT_AVAIL,
2218 "'self' is not valid in this context",
2219 "The 'self' object is not available in this context. You can only "
2220 "refer to 'self' within a method associated with an object; you cannot "
2221 "use 'self' in a function or in other code that is not part of an "
2222 "object's method." },
2223
2224 { TCERR_INH_NOT_AVAIL,
2225 "'inherited' is not valid in this context",
2226 "The 'inherited' construct is not available in this context. You "
2227 "can only use 'inherited' within a method associated with an object "
2228 "with a superclass." },
2229
2230 { TCERR_NO_ADDR_SYM,
2231 "cannot take address of \"%~.*s\"",
2232 "You cannot take the address of \"%~.*s\". You can only take the "
2233 "address of a function or a property." },
2234
2235 { TCERR_CANNOT_ASSIGN_SYM,
2236 "cannot assign to \"%~.*s\"",
2237 "You cannot assign a value to \"%~.*s\". You can only assign a value "
2238 "to an object property, to a local variable or parameter, or to a "
2239 "subscripted element of a list." },
2240
2241 { TCERR_CANNOT_EVAL_LABEL,
2242 "\"%~.*s\" is a label and cannot be evaluated in an expression",
2243 "The symbol \"%~.*s\" is a code label; this symbol cannot be "
2244 "evaluated in an expression. You can only use this symbol "
2245 "in a 'goto' statement." },
2246
2247 { TCERR_CANNOT_CALL_SYM,
2248 "cannot call \"%~.*s\" as a method or function",
2249 "The symbol \"%~.*s\" is not a valid method, function, or expression "
2250 "value. You cannot invoke this symbol as a method or function call. "
2251 "Check spelling, and check for missing operators or mismatched "
2252 "parentheses." },
2253
2254 { TCERR_PROP_NEEDS_OBJ,
2255 "cannot call property \"%~.*s\" without \"object.\" prefix - no \"self\"",
2256 "You cannot call the property \"%~.*s\" in this context without an "
2257 "explicit \"object.\" prefix, because no implied \"self\" object "
2258 "exists in this context. A \"self\" object exists only inside object "
2259 "method code. Check spelling and syntax to ensure you meant to call "
2260 "a property, and add the object qualifier if so." },
2261
2262 { TCERR_VOID_RETURN_IN_EXPR,
2263 "\"%~.*s\" has no return value - cannot use in an expression",
2264 "\"%~.*s\" has no return value, so it cannot be used in an expression "
2265 "(there's no value to use in further calculations). Check the "
2266 "definition of the function or method." },
2267
2268 { TCERR_INVAL_FUNC_ADDR,
2269 "'&' cannot be used with a function name (\"%~.*s\")",
2270 "The '&' operator cannot be used with function name \"%~.*s\". If you "
2271 "want a reference to the function, simply use the name by itself with "
2272 "no argument list. If you want to call the function, put the argument "
2273 "list in parentheses '( )' after the function name; if the function "
2274 "takes no arguments, use empty parentheses '()' after the function's "
2275 "name." },
2276
2277 { TCERR_INVAL_NEW_EXPR,
2278 "cannot apply operator 'new' to this expression",
2279 "You cannot apply operator 'new' to this expression. 'new' can "
2280 "only be applied to an object or metaclass name, followed by an "
2281 "optional argument list. Check for syntax errors." },
2282
2283 { TCERR_TOO_FEW_FUNC_ARGS,
2284 "too few arguments to function \"%~.*s\"",
2285 "Not enough arguments are specified in the call to the "
2286 "function \"%~.*s\". Check the definition of the function, "
2287 "and check for unbalanced parentheses or other syntax errors." },
2288
2289 { TCERR_TOO_MANY_FUNC_ARGS,
2290 "too many arguments to function \"%~.*s\"",
2291 "Too many arguments are specified in the call to the "
2292 "function \"%~.*s\". Check the definition of the function, "
2293 "and check for unbalanced parentheses or other syntax errors." },
2294
2295 { TCERR_SETPROP_NEEDS_OBJ,
2296 "cannot assign to property \"%~.*s\" without \"object.\" prefix - "
2297 "no \"self\"",
2298 "You cannot assign to the property \"%~.*s\" in this context without an "
2299 "explicit \"object.\" prefix, because no implied \"self\" object "
2300 "exists in this context. A \"self\" object exists only inside object "
2301 "method code. Check spelling and syntax to ensure you meant to assign "
2302 "to a property, and add the object qualifier if so." },
2303
2304 { TCERR_SYM_NOT_PROP,
2305 "invalid '.' expression - symbol \"%~.*s\" is not a property",
2306 "The symbol \"%~.*s\" cannot be used after a period '.' because this "
2307 "symbol is not a property. The period in a member evaluation "
2308 "expression must be followed by a property name, or by an expression "
2309 "that yields a property pointer value. Check spelling and check"
2310 "for syntax errors." },
2311
2312 { TCERR_INVAL_PROP_EXPR,
2313 "invalid '.' expression - right side is not a property",
2314 "This property evaluation expression is invalid. The period '.' "
2315 "in a property expression must be followed by a property name, "
2316 "or by an expression that yields a property pointer value. Check "
2317 "spelling and check for syntax errors." },
2318
2319 { TCERR_INH_NOT_OBJ,
2320 "illegal 'inherited' - \"%~.*s\" is not a class",
2321 "This 'inherited' expression is not valid, because \"%~.*s\" is not "
2322 "a class. 'inherited' must be followed by a period '.' or by the "
2323 "name of a superclass of this method's object. Check spelling and "
2324 "expression syntax." },
2325
2326 { TCERR_INVAL_OBJ_EXPR,
2327 "illegal expression - left of '.' is not an object",
2328 "The expression on the left of the period '.' is not an object value. "
2329 "The left of a '.' expression must be an object name, or an expression "
2330 "that evaluates to an object value. Check spelling and syntax." },
2331
2332 { TCERR_SYM_NOT_OBJ,
2333 "symbol \"%~.*s\" is not an object - illegal on left of '.'",
2334 "The symbol \"%~.*s\" is not an object, so you cannot use this "
2335 "symbol on the left side of a period '.' expression. The left side of a "
2336 "'.' expression must be an object name or an expression that evaluates "
2337 "to an object value. Check the spelling and syntax." },
2338
2339 { TCERR_IF_ALWAYS_TRUE,
2340 "\"if\" condition is always true - \"else\" part is unreachable",
2341 "The condition in this \"if\" statement is always true, which means "
2342 "that the code in the \"else\" clause will never be executed. If this "
2343 "is unintentional, check the condition to ensure it's correct." },
2344
2345 { TCERR_IF_ALWAYS_FALSE,
2346 "\"if\" condition is always false",
2347 "The condition in this \"if\" statement is always false, which means "
2348 "that the statement or statements following the \"if\" will never "
2349 "be executed. If this is unintentional, check the condition to "
2350 "ensure it's correct." },
2351
2352 { TCERR_INVALID_BREAK,
2353 "invalid \"break\" - not in a for/while/do/switch",
2354 "This \"break\" statement is invalid. A \"break\" can only appear "
2355 "in the body of a loop (\"for\", \"while\", or \"do\") or within a "
2356 "case in a \"switch\" statement." },
2357
2358 { TCERR_INVALID_CONTINUE,
2359 "invalid \"continue\" - not in a for/while/do",
2360 "This \"continue\" statement is invalid. A \"continue\" can only appear "
2361 "in the body of a loop (\"for\", \"while\", or \"do\")." },
2362
2363 { TCERR_MAIN_NOT_DEFINED,
2364 "function _main() is not defined",
2365 "No function named _main() is defined. This function must be defined, "
2366 "because _main() is the entrypoint to the program at run-time." },
2367
2368 { TCERR_MAIN_NOT_FUNC,
2369 "_main is not a function",
2370 "The global symbol \"_main\" does not refer to a function. This symbol "
2371 "must be defined as a function, because _main() is the entrypoint "
2372 "to the program at run-time." },
2373
2374 { TCERR_CATCH_EXC_NOT_OBJ,
2375 "exception class symbol \"%~.*s\" in \"catch\" clause is not an object",
2376 "The exception class symbol \"%~.*s\" used in this \"catch\" clause "
2377 "is not an object class. Only an object class can be used to "
2378 "specify the type of exception to catch." },
2379
2380 { TCERR_INVALID_BREAK_LBL,
2381 "invalid \"break\" - no label \"%~.*s\" on any enclosing statement",
2382 "This \"break\" is invalid because the label \"%~.*s\" does not "
2383 "refer to an enclosing statement. When a label is used with "
2384 "\"break\", the label must refer to an enclosing statement. "
2385 "Check for unbalanced braces, and check that the label is correct." },
2386
2387 { TCERR_INVALID_CONT_LBL,
2388 "invalid \"continue\" - no label \"%~.*s\" on any enclosing loop",
2389 "This \"continue\" is invalid because the label \"%~.*s\" does not "
2390 "refer to an enclosing statement. When a label is used with "
2391 "\"continue\", the label must refer directly to an enclosing loop "
2392 "(\"while\", \"for\", or \"do\") statement. Check for unbalanced "
2393 "braces, and check that the label is correct." },
2394
2395 { TCERR_INVALID_GOTO_LBL,
2396 "invalid \"goto\" - label \"%~.*s\" is not defined in this function "
2397 "or method",
2398 "This \"goto\" is invalid because the label \"%~.*s\" is not defined "
2399 "in this function or method. Check the label name and correct "
2400 "any misspelling, or insert the missing label definition." },
2401
2402 { TCERR_UNRESOLVED_EXTERN,
2403 "unresolved external reference \"%~.*s\"",
2404 "The symbol \"%~.*s\" was defined as an external reference but "
2405 "is not defined anywhere in the program. Determine where this "
2406 "symbol should be defined, and make sure that the source file "
2407 "that contains the definition is included in the compilation." },
2408
2409 { TCERR_UNREFERENCED_LABEL,
2410 "label \"%~.*s\" is not referenced",
2411 "The statement label \"%~.*s\" is not referenced in any \"goto\", "
2412 "\"break\", or \"continue\" statement. The label is unnecessary "
2413 "and can be removed." },
2414
2415 { TCERR_UNREFERENCED_LOCAL,
2416 "local variable \"%~.*s\" is never used",
2417 "The local variable \"%~.*s\" is never used. This local variable "
2418 "can be removed. Check to make sure that the local variable isn't "
2419 "hidden by another variable of the same name inside nested braces '{ }' "
2420 "within the code." },
2421
2422 { TCERR_UNASSIGNED_LOCAL,
2423 "no value is assigned to local variable \"%~.*s\"",
2424 "No value is assigned to the local variable \"%~.*s\". "
2425 "You should initialize the variable with a value before its first "
2426 "use to make the meaning of the code clear." },
2427
2428 { TCERR_UNUSED_LOCAL_ASSIGNMENT,
2429 "value is assigned to local variable \"%~.*s\" but the value is "
2430 "never used",
2431 "A value is assigned to the local variable \"%~.*s\", but the variable's "
2432 "value is never used. It is possible that the variable can be "
2433 "removed." },
2434
2435 { TCERR_SC_NOT_OBJECT,
2436 "invalid superclass \"%~.*s\" - not an object",
2437 "The superclass \"%~.*s\" is not valid, because the symbol does not "
2438 "refer to an object. Each superclass of an object must be a class "
2439 "or object." },
2440
2441 { TCERR_ARG_EXPR_HAS_NO_VAL,
2442 "argument expression %d yields no value",
2443 "The argument expression in position %d in the argument list yields no "
2444 "value. This usually indicates that the argument expression uses "
2445 "a double-quoted (self-printing) string where a single-quoted string "
2446 "was intended." },
2447
2448 { TCERR_ASI_EXPR_HAS_NO_VAL,
2449 "right side of assignment has no value",
2450 "The expression on the right side of the assignment operator yields "
2451 "no value. This usually indicates that the expression after the "
2452 "assignment operator uses a double-quoted (self-printing) string "
2453 "where a single-quoted string was intended." },
2454
2455 { TCERR_WRONG_ARGC_FOR_FUNC,
2456 "wrong number of arguments to function \"%~.*s\": %s required, %d actual",
2457 "The call to function \"%~.*s\" has the wrong number of arguments. "
2458 "The function requires %s argument(s), but this call has %d. Check "
2459 "the argument list." },
2460
2461 { TCERR_GOTO_INTO_FINALLY,
2462 "'goto' cannot transfer control into a 'finally' block",
2463 "This 'goto' statement transfers control to a label defined in a "
2464 "'finally' block, but the 'goto' statement is not within the same "
2465 "'finally' block. This type of transfer is illegal because it would "
2466 "leave the exit path from the 'finally' undefined." },
2467
2468 { TCERR_UNREFERENCED_PARAM,
2469 "formal parameter \"%~.*s\" is never used",
2470 "The formal parameter \"%~.*s\" is never used. In many cases this "
2471 "doesn't indicate a problem, since a method might receive parameters "
2472 "it doesn't actually need - the method interface might be inherited "
2473 "from a base class, or the extra parameters might be included "
2474 "for possible future use or for architectural reasons. You might "
2475 "want to check that the parameter really wasn't meant to be used; in "
2476 "particular, check to make sure that the parameter isn't hidden "
2477 "by another variable of the same name inside nested braces '{ }' "
2478 "within the code." },
2479
2480 { TCERR_GRAMPROD_HAS_NO_ALTS,
2481 "grammar production \"%~.*s\" has no alternatives defined",
2482 "The grammar production symbol \"%~.*s\" has no alternatives defined. "
2483 "This probably indicates that this symbol was accidentally "
2484 "misspelled when used as a sub-production in a grammar rule. Check "
2485 "for occurrences of this symbol in grammar rules, and correct the "
2486 "spelling if necessary. If the symbol is spelled correctly, add "
2487 "at least one grammar rule for this production." },
2488
2489 { TCERR_CANNOT_MOD_META_PROP,
2490 "intrinsic class property \"%~.*s\" cannot be modified",
2491 "The property \"%~.*s\" is defined in this intrinsic class, "
2492 "so it cannot be modified. You can only add new properties to "
2493 "an intrinsic class; you can never override, modify, or replace "
2494 "properties defined in the intrinsic class itself." },
2495
2496 { TCERR_FOREACH_NO_CREATEITER,
2497 "Container.createIterator is not defined - %s..in is not valid",
2498 "The intrinsic class Container's method createIterator is not defined, "
2499 "so the %s..in syntax cannot be used. This should be corrected if you "
2500 "#include <tads.h> or <systype.h> in this source file." },
2501
2502 { TCERR_FOREACH_NO_GETNEXT,
2503 "Iterator.getNext is not defined - %s..in cannot be used",
2504 "The intrinsic class Iterator's method getNext is not defined, "
2505 "so the '%s..in' statement cannot be used. This should be corrected if "
2506 "you #include <tads.h> or <systype.h> in this source file." },
2507
2508 { TCERR_FOREACH_NO_ISNEXTAVAIL,
2509 "Iterator.isNextAvailable is not defined - %s..in cannot be used",
2510 "The intrinsic class Iterator's method isNextAvailable is not defined, "
2511 "so the '%s..in' statement cannot be used. This should be corrected if "
2512 "you #include <tads.h> or <systype.h> in this source file." },
2513
2514 { TCERR_INVALID_TYPE_FOR_EXPORT,
2515 "symbol \"%~.*s\" is not a valid type for export",
2516 "The symbol \"%~.*s\" appears in an 'export' statement, but this "
2517 "symbol is not of a valid type for export. Only object and property "
2518 "names may be exported." },
2519
2520 { TCERR_DUP_EXPORT,
2521 "duplicate export for external name \"%~.*s\": \"%~.*s\" and \"%~.*s\"",
2522 "Invalid duplicate 'export' statements. The external name \"%~.*s\" "
2523 "has been given to the exported symbols \"%~.*s\" and \"%~.*s\". An "
2524 "external name can be given to only one symbol. You must remove "
2525 "one of the duplicate exports." },
2526
2527 { TCERR_DUP_EXPORT_AGAIN,
2528 "additional duplicate export for external name \"%~.*s\": \"%~.*s\"",
2529 "Additional duplicate export: the external name \"%~.*s\" has also "
2530 "been exported with symbol \"%~.*s\". Only one export per external "
2531 "name is allowed." },
2532
2533 { TCERR_TARGETPROP_NOT_AVAIL,
2534 "'targetprop' is not available in this context",
2535 "The 'targetprop' value is not available in this context. You can only "
2536 "refer to 'targetprop' within a method associated with an object; "
2537 "you cannot use 'targetprop' in a function or in other code that is "
2538 "not part of an object's method." },
2539
2540 { TCERR_TARGETOBJ_NOT_AVAIL,
2541 "'targetobj' is not available in this context",
2542 "The 'targetobj' value is not available in this context. You can only "
2543 "refer to 'targetobj' within a method associated with an object; "
2544 "you cannot use 'targetobj' in a function or in other code that is "
2545 "not part of an object's method." },
2546
2547 { TCERR_DEFININGOBJ_NOT_AVAIL,
2548 "'definingobj' is not available in this context",
2549 "The 'definingobj' value is not available in this context. You can only "
2550 "refer to 'definingobj' within a method associated with an object; "
2551 "you cannot use 'definingobj' in a function or in other code that is "
2552 "not part of an object's method." },
2553
2554 { TCERR_CANNOT_CALL_CONST,
2555 "this constant expression cannot be called as a function",
2556 "This constant expression cannot be called as a function. Check for "
2557 "a missing operator before an open parenthesis, since this can make "
2558 "an expression look like a function call. " },
2559
2560 { TCERR_REPLACED_NOT_AVAIL,
2561 "'replaced' is not available in this context",
2562 "The 'replaced' keyword is not available in this context. You can only "
2563 "use 'replaced' within a function you are defining with 'modify'. " },
2564
2565 { TCERR_GRAMPROD_TOO_MANY_ALTS,
2566 "grammar production \"%~.*s\" has too many (>65,535) rules",
2567 "The grammar production symbol \"%~.*s\" has too many rules - a "
2568 "single production is limited to 65,535 rules, taking into "
2569 "account all 'grammar' statements for the production. This probably "
2570 "indicate that the production has one or more grammar rules with "
2571 "deeply nested '|' alternatives. Check for very complex 'grammar' "
2572 "statements, and replace complex '|' structures with separate "
2573 "sub-productions." },
2574
2575 { TCERR_BAD_META_FOR_NEW,
2576 "invalid 'new' - cannot create an instance of this type",
2577 "The 'new' operator cannot be used to create an instance of this "
2578 "type of object. " },
2579
2580 { TCERR_MMINH_TYPE_NOT_OBJ,
2581 "'inherited<>' type list element \"%~.*s\" is not an object name",
2582 "Type names in an 'inherited<>' type list must be object or "
2583 "class names. \"%~.*s\" is not an object name, so it can't be used "
2584 "as a type name here." },
2585
2586 { TCERR_MMINH_BAD_CONTEXT,
2587 "'inherited<>' is not valid here; it can only be used in a multi-method",
2588 "'inherited<>' is not valid here. This syntax can only be used "
2589 "within a function defined as a multi-method." },
2590
2591 { TCERR_MMINH_MISSING_SUPPORT_FUNC,
2592 "'inherited<>' requires \"%~.*s\", which is not defined "
2593 "or not a function",
2594 "'inherited<>' requires the library function \"%~.*s\" to be included "
2595 "included in the build. This is not defined or is not a function. "
2596 "Check that the library file 'multmeth.t' is included in the build." },
2597
2598 { TCERR_MMINH_UNDEF_FUNC,
2599 "'inherited<>' function \"%~.*s\" undefined",
2600 "The function \"%~.*s\" with the specified inherited<> type list is "
2601 "not defined. The inherited<> type list must exactly match the "
2602 "definition of the function you wish to call." },
2603
2604 { TCERR_NAMED_PARAM_MISSING_FUNC,
2605 "named parameters require support function \"%~.*s\", which is undefined",
2606 "This program uses named parameters, so it depends on the built-in "
2607 "support function \"%~.*s\". This is not defined or is not a built-in "
2608 "function. Check that you're including the current version of the "
2609 "system header file 't3.h' in the build." },
2610
2611 { TCERR_OPT_PARAM_MISSING_FUNC,
2612 "optional parameters require support function \"%~.*s\", which is undefined",
2613 "This program uses optional parameters, so it depends on the built-in "
2614 "support function \"%~.*s\". This is not defined or is not a built-in "
2615 "function. Check that you're including the current version of the "
2616 "system header file 't3.h' in the build. (An optional parameter is "
2617 "a function or method argument declared with a '?' after the variable "
2618 "name, or with '=' and a default expression after the name." },
2619
2620 { TCERR_ONEOF_REQ_GENCLS,
2621 "<<one of>> requires class OneOfIndexGen to be defined in the program",
2622 "<<one of>> requires your program to define the class OneOfIndexGen. "
2623 "This class isn't defined. Make sure that you're using the current "
2624 "version of the system library file _main.t." },
2625
2626 { TCERR_ONEOF_REQ_GETNXT,
2627 "<<one of>> requires getNextIndex to be defined as a property",
2628 "<<one of>> requires your program to define the property getNextIndex, "
2629 "as part of class OneOfIndexGen. This symbol is used as a different "
2630 "type in the program. Make sure that you're using the current version "
2631 "of the sy stem library file _main.t" },
2632
2633 { TCERR_EXT_METACLASS,
2634 "intrinsic class '%.*s' is not defined in this module",
2635 "The intrinsic class '%.*s' is not defined in this source module. "
2636 "To refer to this class within this module, you must declare it. "
2637 "The usual way to declare an intrinsic class is simply to #include "
2638 "the system header file that defines the class, near the beginning "
2639 "of your source file." },
2640
2641 { TCERR_FUNC_CALL_NO_PROTO,
2642 "cannot call extern function %.*s without an argument list definition",
2643 "The function %.*s was declared 'extern' without an argument list "
2644 "definition. This function can't be called without declaring the "
2645 "argument list. You can declare the argument list in the 'extern' "
2646 "statement, but note that in most cases the problem is that the "
2647 "function itself is never defined within the program." },
2648
2649 { TCERR_UNDEF_METACLASS,
2650 "\"%.*s\" is not defined or is not an intrinsic class",
2651 "The compiler requires \"%.*s\" to be defined as an intrinsic class; "
2652 "the symbol is either undefined or is defined as a different type. "
2653 "Check that the system header that defines this class is #included "
2654 "in this source file, and that there are no conflicting definitions "
2655 "of the class name." },
2656
2657 { TCERR_SYMEXP_INV_TYPE,
2658 "invalid symbol type in symbol file",
2659 "Invalid symbol type in symbol file. The symbol file is either "
2660 "corrupted or was created by an incompatible version of the "
2661 "compiler. Regenerate the symbol file." },
2662
2663 { TCERR_SYMEXP_INV_SIG,
2664 "invalid symbol file signature",
2665 "Invalid symbol file signature. The symbol file is corrupted, "
2666 "was generated by an incompatible version of the compiler, or is "
2667 "not a symbol file. Delete this symbol file and re-generate it "
2668 "from its source file. (If you do not have access to the source"
2669 "file, you must obtain an updated symbol file from the person or "
2670 "vendor who provided you with the original symbol file.)" },
2671
2672 { TCERR_SYMEXP_SYM_TOO_LONG,
2673 "symbol name too long in symbol file",
2674 "A symbol name stored in the symbol file is too long. The symbol "
2675 "file is either "
2676 "corrupted or was created by an incompatible version of the "
2677 "compiler. Regenerate the symbol file." },
2678
2679 { TCERR_SYMEXP_REDEF,
2680 "symbol \"%~.*s\" in imported symbol file is already defined; ignoring "
2681 "redefinition",
2682 "The symbol \"%~.*s\" is defined in the symbol file, but is already "
2683 "defined. This usually indicates that two symbol files that you're "
2684 "importing both define this symbol as a function, object, or property "
2685 "name (the two files might define the symbol as the same type, or as "
2686 "different types - it doesn't matter, because the symbol can only be "
2687 "used once for any of these types). You must resolve the conflict "
2688 "by renaming the symbol in one or more of the source files to make each "
2689 "name unique." },
2690
2691 { TCERR_OBJFILE_INV_SIG,
2692 "invalid object file signature",
2693 "Invalid object file signature. The object file is corrupted, "
2694 "was generated by an incompatible version of the compiler, or "
2695 "is not an object file. Delete this object file and re-compile "
2696 "it from its source file. (If you do not have access to the source "
2697 "file, you must obtain an updated object file from the person or "
2698 "vendor who provided you with the original object file." },
2699
2700 { TCERR_OBJFILE_TOO_MANY_IDS,
2701 "too many object/property ID's in object file",
2702 "This object file contains too many object or property ID's. The "
2703 "compiler cannot load this object file on this operating system. "
2704 "This usually happens only on 16-bit computers, and indicates that "
2705 "the object file exceeds the architectural limit of the compiler "
2706 "on this machine. You might be able to work around this by reducing "
2707 "the number of objects in this object file, which you can probably do "
2708 "by splitting the source file into multiple files and compiling each "
2709 "one into its own object file. If you're running on MS-DOS on a "
2710 "386 or higher processor, you can use a 32-bit version of the "
2711 "compiler, which does not have this limit." },
2712
2713 { TCERR_OBJFILE_OUT_OF_MEM,
2714 "out of memory loading object file",
2715 "Out of memory. The compiler cannot "
2716 "allocate memory necessary to load the object file. Make more "
2717 "memory available, if possible (by closing other applications, "
2718 "for example), then try running the compiler again." },
2719
2720 { TCERR_OBJFILE_INV_TYPE,
2721 "invalid symbol type in object file",
2722 "Invalid symbol type in object file. The object file is either "
2723 "corrupted or was created by an incompatible version of the "
2724 "compiler. Re-compile the object file." },
2725
2726 { TCERR_OBJFILE_REDEF_SYM_TYPE,
2727 "symbol \"%~.*s\" (type: %s) redefined (type: %s) in object file \"%s\"",
2728 "The symbol \"%~.*s\", which was originally defined of type %s, is "
2729 "redefined with type %s in object file \"%s\". A global symbol can "
2730 "be defined only once in the entire program. You must change one of "
2731 "the symbol's names in one of your source files to remove the "
2732 "conflict.\n\n"
2733 "If you recently changed the meaning of this symbol, you might "
2734 "simply need to do a full recompile - try building again with the -a "
2735 "option. " },
2736
2737 { TCERR_OBJFILE_REDEF_SYM,
2738 "symbol \"%~.*s\" (type: %s) redefined in object file \"%s\"",
2739 "The symbol \"%~.*s\" (of type %s) is redefined in object file \"%s\". "
2740 "A global symbol can be defined only once in the entire program. "
2741 "You must change one of names in one of your source files to "
2742 "remove the conflict." },
2743
2744 { TCERR_OBJFILE_BIF_INCOMPAT,
2745 "intrinsic function \"%~.*s\" has different definition in object file "
2746 "\"%s\"",
2747 "The intrinsic function \"%~.*s\" has a different definition in object "
2748 "file \"%s\" than in its previous definition. The intrinsic function "
2749 "sets used in your program must be identical in each object file. "
2750 "Check the \"intrinsic\" definition statements in each source file "
2751 "and ensure that they all match." },
2752
2753 { TCERR_OBJFILE_FUNC_INCOMPAT,
2754 "function \"%~.*s\" has different definition in object file "
2755 "\"%s\"",
2756 "The function \"%~.*s\" has a different definition in object "
2757 "file \"%s\" than in its previous definition. This probably indicates "
2758 "that one or more of your object or symbol files are out of date "
2759 "and must be recompiled." },
2760
2761 { TCERR_OBJFILE_INT_SYM_MISSING,
2762 "internal symbol reference \"%~.*s\" missing in object file \"%s\"",
2763 "The internal symbol reference \"%~.*s\" is missing in the object "
2764 "file \"%s\". This is an error in the object file and probably indicates"
2765 " that the file is corrupted. Delete the object file and recompile its "
2766 "source file." },
2767
2768 { TCERR_OBJFILE_INVAL_STREAM_ID,
2769 "invalid stream ID in object file \"%s\"",
2770 "The object file \"%s\" contains an invalid internal stream ID code. "
2771 "This is an error in the object file and probably indicates that "
2772 "the file is corrupted. Delete the object file and recompile its "
2773 "source file." },
2774
2775 { TCERR_OBJFILE_INVAL_OBJ_ID,
2776 "invalid object ID in object file \"%s\"",
2777 "The object file \"%s\" contains an invalid object ID code. "
2778 "This is an error in the object file and probably indicates that "
2779 "the file is corrupted. Delete the object file and recompile its "
2780 "source file." },
2781
2782 { TCERR_OBJFILE_INVAL_PROP_ID,
2783 "invalid property ID in object file \"%s\"",
2784 "The object file \"%s\" contains an invalid property ID code. "
2785 "This is an error in the object file and probably indicates that "
2786 "the file is corrupted. Delete the object file and recompile its "
2787 "source file." },
2788
2789 { TCERR_OBJFILE_INV_FN_OR_META,
2790 "invalid function set or metaclass data in object file \"%s\"",
2791 "The object file \"%s\" contains invalid function set or metaclass "
2792 "data. This is an error in the object file and probably indicates that "
2793 "the file is corrupted. Delete the object file and recompile its "
2794 "source file." },
2795
2796 { TCERR_OBJFILE_FNSET_CONFLICT,
2797 "conflicting intrinsic function set \"%s\" found in object file \"%s\"",
2798 "The intrinsic function set \"%s\" in object file \"%s\" conflicts with "
2799 "a previous intrinsic definition from other object files. Each "
2800 "object file must define an identical list of intrinsics, in "
2801 "the same order. Examine your source files and use the same "
2802 "intrinsic definitions in all files." },
2803
2804 { TCERR_OBJFILE_META_CONFLICT,
2805 "conflicting metaclass \"%s\" found in object file \"%s\"",
2806 "The metaclass \"%s\" in object file \"%s\" conflicts with "
2807 "a previous metaclass definition from other object files. Each "
2808 "object file must define an identical list of metaclasses, in "
2809 "the same order. Examine your source files and use the same "
2810 "metaclass definitions in all files." },
2811
2812 { TCERR_OBJFILE_MODREPOBJ_BEFORE_ORIG,
2813 "modified or replaced object \"%~.*s\" found in object file \"%s\" "
2814 "before original object definition was loaded",
2815 "The object \"%~.*s\" in object file \"%s\" is defined with \"replace\" "
2816 "or \"modify\", but this object file was loaded before the object file "
2817 "containing the original definition of the object. You must change "
2818 "the order in which you're loading the object files so that the "
2819 "object file containing the original definition of each object is "
2820 "loaded before the object's first modification or replacement." },
2821
2822 { TCERR_OBJFILE_REPFUNC_BEFORE_ORIG,
2823 "modified or replaced function \"%~.*s\" found in object file \"%s\" "
2824 "before original function definition was loaded",
2825 "The function \"%~.*s\" in object file \"%s\" is defined with "
2826 "\"modify\" or \"replace\", but this object file was loaded before the "
2827 "object file containing the original definition of the function. You "
2828 "must change the order in which you're loading the object files so "
2829 "that the object file containing the original definition of each "
2830 "function is loaded before the function's first replacement." },
2831
2832 { TCERR_CONSTRUCT_CANNOT_RET_VAL,
2833 "\"construct\" cannot return a value",
2834 "The \"construct\" method cannot return a value. Remove the "
2835 "return value expression." },
2836
2837 { TCERR_OBJFILE_NO_DBG,
2838 "object file \"%s\" has no debugger information "
2839 "(required to link for debug)",
2840 "The object file \"%s\" has no debugger information. In order to "
2841 "include debug information in the image file, all object files must be "
2842 "compiled with debugging information. Recompile the object file with "
2843 "debug information and then re-link the program." },
2844
2845 { TCERR_OBJFILE_METACLASS_PROP_CONFLICT,
2846 "intrinsic class property \"%~.*s\" does not match "
2847 "previous name (\"%~.*s\") in object file %s",
2848 "The intrinsic class property \"%~.*s\" does not match its previous "
2849 "name (\"%~.*s\") in object file %s. Each property defined in an "
2850 "intrinsic class must match in all object files where the "
2851 "intrinsic class is declared. You must recompile your source code "
2852 "using a single definition for the intrinsic class that is the same "
2853 "in each file." },
2854
2855 { TCERR_OBJFILE_METACLASS_IDX_CONFLICT,
2856 "intrinsic class \"%~.*s\" in object file %s out of order with "
2857 "previous definition",
2858 "The intrinsic class \"%~.*s\" is defined in object file %s in a "
2859 "different order than it appeared in previous object files. Each "
2860 "object file must define all of its intrinsic classes in the same "
2861 "order as all other object files. You must recompile your source "
2862 "code using a single set of intrinsic class definitions, all in the "
2863 "same order." },
2864
2865 { TCERR_OBJFILE_CANNOT_MOD_OR_REP_TYPE,
2866 "cannot modify or replace object of this type - \"%~.*s\" in "
2867 "object file %s",
2868 "You cannot use 'modify' or 'replace' to modify an object of this "
2869 "type. The symbol \"%~.*s\" is being modified or replaced in object "
2870 "file %s, but the symbol was previously defined using an incompatible "
2871 "type. You can only modify or replace ordinary objects." },
2872
2873 { TCERR_EXPORT_SYM_TOO_LONG,
2874 "exported symbol in object file is too long - object file may be "
2875 "corrupted",
2876 "An exported symbol in this object file is too long. This probably "
2877 "indicates a corrupted object file. Recompile the source code to "
2878 "create a new object file. If the object file was just compiled, "
2879 "this probably indicates an internal error in the compiler." },
2880
2881 { TCERR_OBJFILE_MACRO_SYM_TOO_LONG,
2882 "macro symbol too long in object file debug records - object file may "
2883 "be corrupted - object file %s",
2884 "A macro symbol name in the object file %s is too long. This probably "
2885 "indicates a corrupted object file. Recompile the source code to "
2886 "create a new object file. If the object file was just compiled, "
2887 "this probably indicates an internal error in the compiler. " },
2888
2889 { TCERR_OBJFILE_MMFUNC_INCOMPAT,
2890 "function \"%~.*s\" has conflicting definitions as multi-method and "
2891 "as regular function - object file %s",
2892 "The function \"%~*.s\" has a definition in object file \"%s\" that "
2893 "conflicts with one or more definitions in other object files. The "
2894 "function is defined both as an ordinary function and as a multi-method. "
2895 "The function must be defined exclusively as one or the other. If the "
2896 "ordinary function definition was meant to be a multi-method definition, "
2897 "add the \"multimethod\" modifier keyword immediately after the "
2898 "closing parenthesis of the parameter list in that definition." },
2899
2900 { TCERR_OBJFILE_MMPARAM_NOT_OBJECT,
2901 "parameter type \"%~.*s\" in multi-method \"%~.*s\" is not an object",
2902 "The declared parameter type \"%~.*s\" in the definition of the "
2903 "multi-method function \"%~.*s\" is not an object. Only object or "
2904 "class names can be used to declare parameter types. Check the "
2905 "definition of the function and make sure the type name is correct, "
2906 "and that the same name isn't used elsewhere as a non-object type." },
2907
2908 { TCERR_MISSING_MMREG,
2909 "library support function \"%s\" is missing or invalid - "
2910 "check that the system library is included in the build",
2911 "The system library function \"%s\" is missing or "
2912 "is not defined as a function. This function is part of the system "
2913 "run-time library, which is usually included by default in the build. "
2914 "Check that system.tl is included in the build and that the "
2915 "multi-method support module is not excluded." },
2916
2917 { TCERR_CONST_POOL_OVER_32K,
2918 "constant value exceeds 32k - program will not run on 16-bit machines",
2919 "This constant data item (string or list constant) exceeds 32k in "
2920 "length (as stored in the compiled program file). This program will "
2921 "not work on 16-bit computers. If you want the program to be able "
2922 "to run on 16-bit machines, break up the string or list into multiple "
2923 "values, and manipulate them separately." },
2924
2925 { TCERR_CONST_TOO_LARGE_FOR_PG,
2926 "string or list constant exceeds constant page size",
2927 "A string or list constant is too large to fit on "
2928 "a single constant page." },
2929
2930 { TCERR_CORRUPT_LIST,
2931 "corrupted internal list data",
2932 "Corrupted internal list data." },
2933
2934 { TCERR_GEN_CODE_INH,
2935 "attempting to generate 'inherited' node directly",
2936 "Attempting to generate 'inherited' node directly." },
2937
2938 { TCERR_GEN_UNK_CONST_TYPE,
2939 "unknown constant type in code generation",
2940 "Unknown constant type in code generation." },
2941
2942 { TCERR_GEN_BAD_LVALUE,
2943 "attempting to generate assignment for non-lvalue",
2944 "Attempting to generate assignment for non-lvalue." },
2945
2946 { TCERR_GEN_BAD_ADDR,
2947 "attempting to generate address for non-addressable",
2948 "Attempting to generate address for non-addressable." },
2949
2950 { TCERR_TOO_MANY_CALL_ARGS,
2951 "function call argument list exceeds machine limit (maximum 127)",
2952 "This function call has too many arguments; the T3 VM limits function "
2953 "and method calls to a maximum of 127 arguments. Check for missing "
2954 "parentheses if you didn't intend to pass this many arguments. If the "
2955 "function actually does take more than 127 arguments, you will have "
2956 "to modify your program to reduce the argument count; you could do "
2957 "this by grouping arguments into an object or list value, or by "
2958 "breaking the function into several simpler functions." },
2959
2960 { TCERR_TOO_MANY_CTOR_ARGS,
2961 "'new' argument list exceeds machine limit (maximum 126)",
2962 "This 'new' operator has too many arguments; the T3 VM limits "
2963 "constructor calls to a maximum of 126 arguments. Check for missing "
2964 "parentheses if you didn't intend to pass this many arguments. If the "
2965 "constructor actually does take more than 126 arguments, you will have "
2966 "to modify your program to reduce the argument count; you could do "
2967 "this by grouping arguments into an object or list value." },
2968
2969 { TCERR_GEN_CODE_DELEGATED,
2970 "attempting to generate 'delegated' node directly",
2971 "Attempting to generate 'delegated' node directly." },
2972
2973 { TCERR_CODE_POOL_OVER_32K,
2974 "code block size exceeds 32k - program will not run on 16-bit machines",
2975 "This code block (a function or method body) exceeds 32k in length "
2976 "(as stored in the compiled program file). This program will not work "
2977 "on 16-bit computers. If you want the program to be able to run on "
2978 "16-bit machines, break up this function or method into multiple "
2979 "pieces." },
2980
2981 { TCERR_GEN_BAD_CASE,
2982 "case/default without switch or non-constant case expression",
2983 "case/default without switch or non-constant case expression" },
2984
2985 { TCERR_CATCH_FINALLY_GEN_CODE,
2986 "catch/finally gen_code called directly",
2987 "catch/finally gen_code called directly" },
2988
2989 { TCERR_INVAL_PROP_CODE_GEN,
2990 "invalid property value type for code generation",
2991 "invalid property value type for code generation" },
2992
2993 { TCERR_RESERVED_EXPORT,
2994 "external name \"%~.*s\" illegal in 'export' - reserved for compiler use",
2995 "The external name \"%~.*s\" illegally appears in an 'export' statement. "
2996 "The compiler automatically provides an export for this symbol, "
2997 "so the program cannot explicitly export this name itself." },
2998
2999 { TCERR_EXPR_TOO_COMPLEX,
3000 "expression too complex",
3001 "The expression is too complex. If possible, simplify the "
3002 "expression by breaking it up into sub-expressions, storing "
3003 "intermediate values in local variables." },
3004
3005 { TCERR_CONSTRUCT_NOT_DEFINED,
3006 "property \"construct\" is not defined",
3007 "No property named \"construct\" is defined. Creating an object "
3008 "with operator 'new' invokes this property if defined." },
3009
3010 { TCERR_CONSTRUCT_NOT_PROP,
3011 "\"construct\" is not a property",
3012 "The symbol \"construct\" does not refer to a property. Creating "
3013 "an object with operator 'new' invokes this property if defined." },
3014
3015 { TCERR_FINALIZE_NOT_DEFINED,
3016 "property \"finalize\" is not defined",
3017 "No property named \"finalize\" is defined. This property is "
3018 "invoked when an object is about to be deleted during garbage "
3019 "collection." },
3020
3021 { TCERR_FINALIZE_NOT_PROP,
3022 "\"finalize\" is not a property",
3023 "The symbol \"finalize\" does not refer to a property. This property "
3024 "is invoked when an object is about to be deleted during garbage "
3025 "collection." },
3026
3027 { TCERR_BAD_JS_TPL,
3028 "invalid js template", "Invalid js template." },
3029
3030 { TCERR_JS_EXPR_EXPAN_OVF,
3031 "js template expansion overflow", "Overflow expanding js template." }
3032 };
3033
3034 /* english message count */
3035 size_t tc_message_count_english =
3036 sizeof(tc_messages_english)/sizeof(tc_messages_english[0]);
3037
3038 /*
3039 * the actual message array - we'll initialize this to the english list
3040 * that's linked in, but if we find an external message file, we'll use
3041 * the external file instead
3042 */
3043 const err_msg_t *tc_messages = tc_messages_english;
3044
3045 /* message count - initialize to the english message array count */
3046 size_t tc_message_count =
3047 sizeof(tc_messages_english)/sizeof(tc_messages_english[0]);
3048