-
Notifications
You must be signed in to change notification settings - Fork 0
/
tcerrmsg.cpp
3048 lines (2603 loc) · 147 KB
/
tcerrmsg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifdef RCSID
static char RCSid[] =
"$Header$";
#endif
/*
* Copyright (c) 2000, 2002 Michael J. Roberts. All Rights Reserved.
*
* Please see the accompanying license file, LICENSE.TXT, for information
* on using and copying this software.
*/
/*
Name
tcerrmsg.cpp - TADS 3 Compiler error message text
Function
Defines the error message strings for the TADS 3 compiler. The message
strings are all isolated in this module to allow for easy replacement
for translated versions.
Notes
Modified
05/13/00 MJRoberts - Creation
*/
#include "tcerr.h"
#include "tcerrnum.h"
/* ------------------------------------------------------------------------ */
/*
* Error Messages - fixed English version; these can be replaced at
* run-time by messages loaded from an external file, but we compile in an
* English set as a fallback in case there's no message file.
*
* The messages must be sorted by message number, so that we can perform a
* binary search to look up a message by number.
*/
const err_msg_t tc_messages_english[] =
{
{ TCERR_LINE_MEM,
"out of memory for line source",
"Out of memory for line source. The source line may be too long, "
"or you may need to make more memory available to the compiler "
"by closing other applications." },
{ TCERR_INV_PP_DIR,
"invalid preprocessor directive",
"\"%~.*s\" is not a valid preprocessor '#' directive." },
{ TCERR_CANT_LOAD_CHARSET,
"unable to load #charset",
"Unable to load the character set specified in the #charset directive. "
"Check the spelling of the character set name, and make sure that "
"a character mapping file (with a name ending in \".TCM\") is "
"available. Refer to the compiler's installation notes for your "
"type of computer for details." },
{ TCERR_UNEXPECTED_CHARSET,
"unexpected or invalid #charset",
"Unexpected or invalid #charset directive. This directive must "
"be at the very beginning of the file, and must specify a character "
"set name enclosed in double quotes." },
{ TCERR_BAD_INC_SYNTAX,
"syntax error in #include",
"Invalid #include syntax - the filename must be enclosed with "
"'\"' or '< >' characters." },
{ TCERR_INC_NOT_FOUND,
"cannot open include file \"%.*s\"",
"The compiler cannot access the #include file \"%.*s\". "
"Check the filename to ensure that it's spelled correctly, and check "
"the compiler's include path setting (command line \"-I\" options) "
"to ensure that the compiler is searching in the directory or folder "
"containing the file. If the file exists, make sure that it's not "
"being used by another application and that you have permission "
"to read the file." },
{ TCERR_REDUNDANT_INCLUDE,
"file \"%.*s\" previously included; ignored",
"The #include file \"%.*s\" has already been included. "
"This redundant inclusion will be ignored." },
{ TCERR_BAD_DEFINE_SYM,
"invalid symbol \"%~.*s\" for #define",
"Invalid symbol \"%~.*s\" for #define. A #define symbol must start "
"with an ASCII letter or underscore symbol '_', and must contain "
"only ASCII letters, digits, and underscores." },
{ TCERR_MACRO_NO_RPAR,
"missing ')' in macro parameter list",
"The macro parameter list is missing a right parenthesis ')' at "
"the end of the list." },
{ TCERR_BAD_MACRO_ARG_NAME,
"invalid macro parameter name \"%~.*s\"",
"Invalid macro parameter name \"%~.*s\". A macro parameter name must "
"start with an ASCII letter or underscore symbol '_', and must contain "
"only ASCII letters, digits, and underscores." },
{ TCERR_MACRO_EXP_COMMA,
"expected ',' or ')' in macro parameter list (found \"%~.*s\")",
"Expected a comma ',' or right parenthesis ')' in the macro "
"parameter list, but found \"%~.*s\"." },
{ TCERR_MACRO_REDEF,
"redefinition of macro \"%~.*s\"",
"Macro \"%~.*s\" has been previously defined; this new definition "
"replaces the previous definition." },
{ TCERR_UNKNOWN_PRAGMA,
"unrecognized #pragma \"%~.*s\"; ignored",
"Unrecognized #pragma \"%~.*s\"; ignored. (The compiler ignores "
"#pragma directives that it doesn't understand, in case you're "
"using a #pragma meant for another compiler, but if you meant "
"the #pragma for this compiler, you need to correct a problem "
"with it.)" },
{ TCERR_BAD_PRAGMA_SYNTAX,
"invalid syntax for #pragma",
"Invalid syntax for #pragma." },
{ TCERR_PP_EXTRA,
"extra characters on line",
"Extra characters found after the end of the preprocessor directive. "
"Check the syntax and remove the extraneous characters at the "
"end of the line." },
{ TCERR_IF_NESTING_OVERFLOW,
"#if nesting too deep",
"#if/#ifdef nesting is too deep - you have specified more "
"#if's within other #if's than the compiler allows. (The compiler "
"has an internal limit on this nesting; you must simplify the "
"nested #if structure of your source code.)" },
{ TCERR_PP_ELSE_WITHOUT_IF,
"#else without #if",
"#else without a matching #if or #ifdef." },
{ TCERR_PP_ENDIF_WITHOUT_IF,
"#endif without #if",
"#endif without a matching #if or #ifdef." },
{ TCERR_PP_ELIF_WITHOUT_IF,
"#elif without #if",
"#elif without a matching #if." },
{ TCERR_PP_INT_REQUIRED,
"integer value required in preprocessor constant expression",
"Incorrect value in preprocessor constant expression - an integer "
"value is required." },
{ TCERR_PP_INCOMP_TYPES,
"incompatible types for comparison operator",
"Incompatible types for comparison in preprocessor constant "
"expression." },
{ TCERR_PP_EXPR_EXTRA,
"extra characters at end of line",
"Extra characters found after end of preprocessor constant "
"expression. Check the syntax of the expression and remove any "
"extraneous characters at the end of the line." },
{ TCERR_PP_DIV_ZERO,
"divide by zero in constant expression",
"Division by zero in preprocessor constant expression." },
{ TCERR_PP_INVALID_VALUE,
"expected number, symbol, or string (found \"%~.*s\")",
"Expected a number, symbol, or single-quoted string in preprocessor "
"constant expression, but found \"%~.*s\"." },
{ TCERR_PP_UNTERM_STRING,
"unterminated string in preprocessor constant expression",
"Unterminated string found in a preprocessor constant expression. "
"(A string in a preprocessor expression must be contained entirely "
"on a single line.)" },
{ TCERR_PP_UNMATCHED_LPAR,
"unmatched '('",
"Unmatched left parenthesis '(' in preprocessor constant expression." },
{ TCERR_PP_BAD_NOT_VAL,
"integer value required for '!' operator",
"Integer value is required for '!' operator in preprocessor "
"expression." },
{ TCERR_PP_MACRO_ARG_RPAR_1LINE,
"missing ')' in argument list for macro \"%~.*s\"",
"Missing right parenthesis ')' in argument list in invocation of "
"macro \"%~.*s\". The entire argument list must be on a single "
"logical line for a line with a preprocessor directive (but you can "
"extend the logical line over several physical lines by ending each "
"line but the last with a backslash '\\')." },
{ TCERR_PP_NO_MACRO_ARGS,
"missing argument list for macro \"%~.*s\"",
"An argument list must be specified in invocation of macro \"%~.*s\"." },
{ TCERR_PP_FEW_MACRO_ARGS,
"not enough arguments for macro \"%~.*s\"",
"Not enough arguments are specified in invocation of macro \"%~.*s\"." },
{ TCERR_PP_MACRO_ARG_RPAR,
"missing ')' in argument list for macro \"%~.*s\"",
"Missing right parenthesis ')' in argument list in "
"invocation of macro \"%~.*s\"." },
{ TCERR_PP_MANY_MACRO_ARGS,
"too many arguments for macro \"%~.*s\"",
"Too many arguments found in invocation of macro \"%~.*s\". (The "
"macro was defined to take fewer arguments. Check the definition "
"of the macro for proper usage, and make sure that all of the "
"parentheses in the macro invocation are properly matched.)" },
{ TCERR_PP_DEFINED_NO_SYM,
"symbol required for defined() (found \"%~.*s\")",
"Symbol required for defined() preprocessor operator "
"(found \"%~.*s\" instead.)" },
{ TCERR_PP_DEFINED_RPAR,
"missing ')' in defined()",
"Missing right parenthesis ')' in defined() preprocess operator." },
{ TCERR_SYMBOL_TRUNCATED,
"symbol \"%~.*s\" truncated to \"%~.*s\"",
"The symbol \"%~.*s\" is too long; it has been truncated to \"%~.*s\". "
"(The compiler limits the length of each symbol name; you must make "
"this symbol name shorter.)" },
{ TCERR_TOO_MANY_MAC_PARMS,
"too many parameters for macro \"%~.*s\" (maximum %d)",
"Too many formal parameters are defined for macro "
"\"%~.*s\". (The compiler imposes a limit of %d parameters per macro.)" },
{ TCERR_NO_STRBUF_MEM,
"out of memory for string buffer",
"Out of memory for string buffer. You may need to "
"close other applications to make more memory available for "
"the compiler." },
{ TCERR_CANT_OPEN_SRC,
"unable to open source file \"%.*s\"",
"Unable to open source file \"%.*s\" - check that the filename "
"is spelled correctly, and check that the file exists and that you "
"have permission to open the file for reading." },
{ TCERR_ERROR_DIRECTIVE,
"#error : %.*s",
"#error : %.*s" },
{ TCERR_OUT_OF_MEM_MAC_EXP,
"out of memory for macro expansion",
"Out of memory for macro expansion. You may need to "
"close other applications to make more memory available for "
"the compiler." },
{ TCERR_LINE_REQ_INT,
"integer value required for #line",
"An integer value is required for the line number in the #line "
"directive." },
{ TCERR_LINE_FILE_REQ_STR,
"string value required for #line",
"A string value is required for the filename in the #line directive." },
{ TCERR_IF_WITHOUT_ENDIF,
"#if without #endif (line %ld, file %.*s)",
"The #if directive at line %ld of file %.*s has no matching #endif "
"(a matching #endif is required in the same file as the #if)." },
{ TCERR_UNSPLICE_NOT_CUR,
"unsplicing invalid line",
"Unsplicing invalid line." },
{ TCERR_MULTI_UNSPLICE,
"too much unsplicing",
"Too much unsplicing." },
{ TCERR_PP_ELIF_NOT_IN_SAME_FILE,
"#elif without #if",
"#elif without #if - an entire #if-#elif-#else-#endif sequence must "
"all be contained within a single file; this #elif appears to "
"correspond to a #if in the including file." },
{ TCERR_PP_ELSE_NOT_IN_SAME_FILE,
"#else without #if",
"#else without #if - an entire #if-#elif-#else-#endif sequence must "
"all be contained within a single file; this #else appears to "
"correspond to a #if in the including file." },
{ TCERR_PP_ENDIF_NOT_IN_SAME_FILE,
"#endif without #if",
"#endif without #if - an entire #if-#elif-#else-#endif sequence must "
"all be contained within a single file; this #endif appears to "
"correspond to a #if in the including file." },
{ TCERR_REDEF_OP_DEFINED,
"cannot #define reserved preprocessor symbol \"defined\"",
"You cannot #define \"defined\" as a macro - this symbol is reserved "
"as a preprocessor keyword and cannot be defined as a macro name." },
{ TCERR_POSSIBLE_UNTERM_STR,
"string appears unterminated (';' or '}' appears alone on line %ld)",
"This string appears unterminated, because ';' or '}' appears on a line "
"with no other non-blank characters (at line %ld) within the string. "
"Check the string for proper termination; if the string is "
"properly terminated and the ';' or '}' is meant to be part of the "
"string, move the ';' or '}' onto the next or previous line to group "
"it with at least one other non-whitespace character, so that it "
"doesn't confuse the compiler" },
{ TCERR_SRCLINE_TOO_LONG,
"source line too long (exceeds maximum line length %ld bytes)",
"This source line is too long - it exceeds the internal compiler "
"limit of %ld bytes per source line. (The compiler's idea of the "
"length of the logical source line may be longer than the line appears "
"to be in the source file, because the compiler limit applies to the "
"line after expansion of macros, assembly of all parts of any string "
"that runs across several lines into a single line, and splicing of "
"any lines that end in backslash characters '\\'. You must reduce "
"the length of the logical source line; check in particular for any "
"quoted strings that run across several lines. " },
{ TCERR_INVALID_CHAR,
"invalid character in input \"%~.*s\"",
"Invalid character in input: \"%~.*s\". This character is not valid "
"in any symbol name or as punctuation in source code; the character "
"will be ignored. Check for missing quotes around a string, a missing "
"ending quote for a string just before this point, or for "
"a quote mark embedded within an earlier string (if you want to use "
"a quote mark within a string, you must precede the quote mark with "
"a backslash '\\')." },
{ TCERR_PP_QC_MISSING_COLON,
"missing colon ':' after conditional operator '?' in preprocessor "
"expression",
"The preprocessor constant conditional expression on this line is "
"missing the colon ':' part. A question-mark operator '?' must be "
"followed by the true-part, then a colon ':', then the false-part. "
"Check the expression to ensure proper placement of parentheses, "
"and check for other errors in the expression syntax. " },
{ TCERR_PP_EXPR_NOT_CONST,
"preprocessor expression is not a constant value",
"The preprocessor expression given does not have a constant value. "
"A preprocessor expression (in a #if, #elif, or #line directive) "
"must use only numbers and strings, or #define symbols defined as "
"numbers or strings. Preprocessor expressions cannot include "
"variables, function calls, property references, or other values "
"that do not have a constant value during compilation." },
{ TCERR_CANT_LOAD_DEFAULT_CHARSET,
"can't load mapping file for default character set \"%s\"",
"The compiler cannot open the mapping file for the default "
"character set, \"%s\". Make sure that a mapping file for this "
"character set (with the same name as the character set plus the "
"suffix \".TCM\") is properly installed on your system. Refer "
"to the compiler's installation notes for your type of "
"computer for details. You might need to re-install the compiler." },
{ TCERR_MACRO_ELLIPSIS_REQ_RPAR,
"'...' in macro formal parameter list must be followed by ')' - "
"found \"%~.*s\"",
"An ellipsis '...' in a macro formal parameter list can only be "
"used with the last parameter to the macro, so it must be immediately "
"followed by a close parenthesis ')' - the compiler found \"%~.*s\" "
"instead. Check the macro definition syntax and insert the missing "
"parenthesis." },
{ TCERR_PP_FOREACH_TOO_DEEP,
"#foreach/#ifempty/#ifnempty nesting too deep",
"This line uses a macro whose expansion has too many nested uses "
"of #foreach, #ifempty, and #ifnempty for its variable arguments. "
"You must simplify the expansion text to reduce the nesting (in "
"other words, you must reduce the number of these constructs that "
"are contained within the expansion areas of others of these "
"same constructs)." },
{ TCERR_TRAILING_SP_AFTER_BS,
"line ends with whitespace following backslash",
"This line ends with one or more whitespace characters (space, tab, "
"etc.) following a backslash '\\'. A backslash at the end of a line "
"is most frequently used to indicate a continuation line, where "
"a long preprocessor directive is broken up over several lines "
"in the source file. To indicate line continuation, though, the "
"backslash must be the very last character on the line; because of "
"the extra whitespace after the backslash on this line, the "
"preprocessor must treat the backslash as quoting the whitespace "
"character that follows. If you meant to indicate line continuation, "
"remove the trailing whitspace. If you actually intended to escape "
"the whitespace character, you can suppress this warning by adding "
"a comment (a simple '//' is adequate) at the end of the line." },
{ TCERR_EXTRA_INC_SYNTAX,
"extraneous characters following #include filename",
"This #include line has extra characters after the name of the file. "
"The only thing allowed on a #include line is the filename, enclosed "
"in quotes (\"filename\") or angle brackets (<filename>). This line "
"has extra characters after the filename specification. Check the "
"syntax and remove the extraneous text. If the extra text is "
"supposed to be a comment, make sure the comment syntax is correct." },
{ TCERR_NESTED_COMMENT,
"\"/*\" found within \"/* ... */\" - nested comments are not allowed",
"The compiler found \"/*\" within a block comment (a \"/* ... */\" "
"sequence). This type of comment cannot be nested. If you didn't "
"intend to create a nested comment, the problem could be that the "
"previous block comment is missing its \"*/\" end marker - you might "
"want to check the previous comment to make sure it ended properly. "
"If you did want to create a nested comment, consider using \"//\" "
"comments instead, or you can use #if 0 ... #endif to comment out "
"a large block." },
{ TCERR_UNMAPPABLE_CHAR,
"unmappable character in input",
"The compiler encountered an \"unmappable\" character in the input. "
"This is a character that's not defined as part of the source file "
"character set you're using, so the compiler doesn't know how to "
"interpret it. This can happen if you've declared the file to be "
"in plain ASCII, via a #charset \"us-ascii\" directive, but the file "
"actually contains characters outside of the plain ASCII range. "
"The same can happen with the ISO-8859 (Latin-1, etc) character sets, "
"since these do not define all possible character codes. Check for "
"any accented letters or special symbols. If you don't see any of "
"these, there might be invisible control characters or spaces causing "
"the problem. If you are intentionally using accented characters, "
"add a #charset directive to the start of the file to indicate the "
"correct character set that your text editor is using when saving "
"the source file." },
{ TCERR_DECIMAL_IN_OCTAL,
"decimal digit found in octal constant \"%.*s\"",
"The compiler found a decimal digit (an 8 or a 9) within the octal "
"constant value \"%.*s\". When you start a numeric constant with the "
"digit zero (0), it signifies an octal constant - that is, a number "
"written in base-8 notation. Octal numbers can only contain the "
"digits 0 through 7, so you can't use an 8 or a 9 in this type of "
"constant. If you didn't mean this to be interpreted as an octal "
"value, simply remove the leading zero. Otherwise, remove the "
"invalid digits from the octal number." },
{ TCERR_LTGT_OBSOLETE,
"the '<>' operator is obsolete - use '!=' instead",
"The '<>' operator is obsolete - use '!=' instead. TADS 2 treated "
"'<>' as equivalent to '!=', but TADS 3 doesn't allow '<>', because "
"the varying operator syntax was sometimes confusing to people "
"reading source code." },
{ TCERR_INT_CONST_OV,
"constant value exceeds integer range; promoted to BigNumber",
"The numeric value specified is outside of the range that can be "
"stored in the TADS integer type (-2147483648 to +2147483647), so it "
"has been automatically promoted to a BigNumber (floating point) "
"value. BigNumber values can represent much larger numbers than "
"TADS integers, but some functions that require numeric arguments "
"only accept integer values. If you're using this value in such a "
"context, it might cause an error at run-time." },
{ TCERR_BACKSLASH_SEQ,
"invalid backslash escape sequence \\%c in string",
"The backslash sequence \\%c is not valid." },
{ TCERR_NON_ASCII_SYMBOL,
"symbol \"%~.*s\" contains non-ASCII character (U+%04x)",
"The symbol \"%~.*s\" contains one or more non-ASCII characters (the "
"first is [Unicode] character U+%04x). Only plain ASCII characters "
"can be used in symbols; accented letters and other non-ASCII "
"characters aren't allowed." },
{ TCERR_EMBEDDING_TOO_DEEP,
"embedded expressions in strings are nested too deeply",
"The embedded \"<< >>\" expressions in this string are nested too "
"deeply. A nested embedding is a \"<< >>\" expression within "
"a string that iself contains another string that has its own "
"\"<< >>\" embedding, which in turn has another string with its "
"own embedding, and so on. This is allowed, but only to a limited "
"nesting depth. You will need to simplify the strings to reduce "
"the depth." },
{ TCERR_INTERNAL_EXPLAN,
"Please report this error to the compiler's maintainer.",
"This indicates a problem within the compiler itself. Please report "
"this problem to the compiler's maintainer -- refer to the README file "
"or release notes for contact information." },
{ TCERR_INTERNAL_ERROR,
"general internal error",
"general internal error" },
{ TCERR_MAKE_CANNOT_CREATE_SYM,
"error creating symbol file \"%s\"",
"Error creating symbol file \"%s\". Check to make sure the filename "
"contains only valid characters, that the path is valid, and that "
"you have the required permissions to create the file." },
{ TCERR_MAKE_CANNOT_CREATE_OBJ,
"error creating object file \"%s\"",
"Error creating object file \"%s\". Check to make sure the filename "
"contains only valid characters, that the path is valid, and that "
"you have the required permissions to create the file." },
{ TCERR_MAKE_CANNOT_CREATE_IMG,
"error creating image file \"%s\"",
"Error creating image file \"%s\". Check to make sure the filename "
"contains only valid characters, that the path is valid, and that "
"you have the required permissions to create the file." },
{ TCERR_MAKE_CANNOT_OPEN_SYM,
"error opening symbol file \"%s\" for reading",
"Error opening symbol file \"%s\" for reading. Check that the "
"file exists and that its name and path are valid." },
{ TCERR_MAKE_CANNOT_OPEN_OBJ,
"error opening object file \"%s\" for reading",
"Error opening object file \"%s\" for reading. Check that the "
"file exists and that its name and path are valid." },
{ TCERR_MAKE_CANNOT_OPEN_IMG,
"error opening image file \"%s\" for reading",
"Error opening image file \"%s\" for reading. Since this is an "
"intermediate file created during the build process, this probably "
"indicates a problem with the filename path, directory permissions, "
"or disk space." },
{ TCERR_TOO_MANY_ERRORS,
"too many errors (try fixing the first couple of errors and recompiling)",
"Too many errors - aborting compilation. Don't panic! Your source "
"code probably doesn't have nearly as many errors as the compiler "
"is reporting. In all likelihood, the compiler got tripped up after "
"the first couple of errors and hasn't been able to get itself "
"re-synchronized with your code - it thinks there are errors only "
"because it's trying to interpret the code in the wrong context. You "
"should simply fix the first few errors, then try compiling your "
"program again - chances are the compiler will get a lot further "
"if you fix just the first few errors. If you want, you can save a "
"copy of the current source code and send it to TADS's author, who "
"might be able to make the compiler a little smarter about dealing "
"with whatever is confusing it so badly." },
{ TCERR_MODULE_NAME_COLLISION,
"module %s the has same name as an existing module",
"The module \"%s\" has the same name as an existing module elsewhere "
"in the project. The root filename of each module must be unique, "
"because the two modules' object files might otherwise overwrite one "
"another. You must change the name of one of the modules so that "
"each module has a unique name." },
{ TCERR_MODULE_NAME_COLLISION_WITH_LIB,
"module %s has the same name as an existing module from library \"%s\"",
"The module %s has the same name as an existing module included "
"from the library \"%s\". The root filename of each module must be "
"unique, even for files included from libraries. If more than one "
"module has the same root name, the modules' object files would "
"overwrite one another. You must change the name of this module "
"to a name not used anywhere else in the project." },
{ TCERR_SOURCE_FROM_LIB,
"\"%s\" (from library \"%s\")",
"\"%s\" (from library \"%s\")" },
{ TCERR_CANNOT_CREATE_DIR,
"unable to create directory \"%s\"",
"An error occurred creating the directory/folder \"%s\". This might "
"mean that the name contains invalid characters, the disk is "
"full, or you don't have the necessary permissions or privileges "
"to create a new file in the parent folder." },
{ TCERR_CONST_DIV_ZERO,
"divide by zero in constant expression",
"Division by zero in constant expression. (The compiler was trying "
"to calculate the value of this expression because it appears to be "
"constant. Check for any macros that might expand to zero, and check "
"for proper placement of parentheses.)" },
{ TCERR_NO_MEM_PRS_TREE,
"out of memory - cannot allocate parse tree block",
"Out of memory. (The compiler was trying to allocate space for a "
"\"parse tree block,\" which stores an intermediate form of your "
"program source code during compilation. If possible, make more "
"memory available to the compiler by closing other applications or "
"reconfiguring any background tasks, services, or device drivers "
"that can be changed to use less memory.)" },
{ TCERR_PRS_BLK_TOO_BIG,
"parse block too big (size=%ld)",
"Parse block too big (size=%ld)." },
{ TCERR_INVALID_LVALUE,
"invalid lvalue - cannot assign to expression on left of \"%s\"",
"Invalid \"lvalue\". The expression on the left-hand side of the "
"operator \"%s\" cannot be used as the destination of an assignment. "
"You can only assign values to expressions such as local variables, "
"object properties, and list elements. "
"Check for missing or extra parentheses and operators. " },
{ TCERR_QUEST_WITHOUT_COLON,
"missing ':' in '?' conditional expression",
"The ':' part of a '?' conditional expression is missing. A '?' "
"expression uses the syntax (condition ? true-part : false-part). "
"Check for missing parentheses or other errors in the "
"condition or true-part expression." },
{ TCERR_INVALID_UNARY_LVALUE,
"invalid lvalue - cannot apply \"%s\" operator to expression",
"The \"%s\" operator cannot be applied to this expression. This "
"operator can only be applied to an expression that can be used in "
"an assignment, such as local variables, object properties, and "
"list elements. Check for missing or extra parentheses." },
{ TCERR_DELETE_OBSOLETE,
"operator 'delete' is obsolete; expression has no effect",
"The 'delete' operator is obsolete. The compiler still accepts "
"'delete' expressions, but they have no effect at run-time. (The "
"run-time system now provides automatic deletion of objects as "
"they become unreachable, so explicit deletion is no longer "
"necessary. You can simply remove all 'delete' expressions from "
"your program.)" },
{ TCERR_NO_ADDRESS,
"invalid address expression - can't apply '&' operator",
"The unary '&' operator cannot be applied to this expression. You "
"can only apply the '&' prefix operator to function names and property "
"names. Check the expression after the '&' to make sure it is a valid "
"function or property name, and check for other expression errors, "
"such as unbalanced parentheses." },
{ TCERR_CONST_UNARY_REQ_NUM,
"unary '%s' operator requires numeric value in constant expression",
"The '%s' operator must be followed by a numeric value in a constant "
"expression. The value after the operator is a constant value, but "
"is not a number." },
{ TCERR_CONST_BINARY_REQ_NUM,
"binary '%s' operator requires numeric value in constant expression",
"The '%s' operator must be applied only to numeric values in a constant "
"expression. Both of the values are constants, but both are not "
"numbers." },
{ TCERR_CONST_BINPLUS_INCOMPAT,
"incompatible constant types for two-operand '+' operator",
"The constant types in this expression are not compatible for use "
"with the two-operand '+' operator. You can add two numbers, or add a "
"non-list value to a string, or add a value to a list; other "
"combinations are not allowed." },
{ TCERR_EXPR_MISSING_RPAR,
"expected ')' but found \"%~.*s\"",
"This expression is missing a right parenthesis ')' - \"%~.*s\" is "
"where the ')' should go. The parenthesis is required to "
"match an earlier left parenthesis '('. Check to make sure the "
"parentheses are properly balanced, and check for unterminated "
"strings and missing operators." },
{ TCERR_BAD_PRIMARY_EXPR,
"expected integer, string, symbol, '[', or '(', but found \"%~.*s\"",
"Invalid expression; expected an integer value, a string value (in "
"single or double quotes), a symbolic name (such as a function, "
"object, or property name), a list constant enclosed in square "
"brackets '[ ]', or an expression in parentheses '( )', but "
"found \"%~.*s\"." },
{ TCERR_CONST_BAD_COMPARE,
"incompatible types for comparison in constant expression",
"This constant expression contains a comparison operator ('<', '<=', "
"'>', or '>=') that attempts to compare values of incompatible types "
"(you can compare an integer to an integer, a string to a string, "
"or a floating-point value to another floating point value). Check "
"the expression and correct the invalid comparison." },
{ TCERR_EXPECTED_SEMI,
"expected ';', but found \"%~.*s\"",
"Expected a semicolon ';' but found \"%~.*s\". Please add the "
"required semicolon. If a semicolon is already present, check "
"for unbalanced parentheses or other expression errors." },
{ TCERR_EXPECTED_STR_CONT,
"expected '>>' and the string continuation, but found \"%~.*s\"",
"Expected '>>' after the embedded expression, followed by the "
"continuation of the string, but found \"%~.*s\" instead. Check the "
"embedded expression (between '<<' and '>>') for errors, such as "
"unbalanced parentheses, and check that the string is properly "
"continued after a '>>' sequence." },
{ TCERR_EXPECTED_ARG_COMMA,
"expected ',' or ')' in argument list, but found \"%~.*s\"",
"Expected a comma ',' or right parenthesis ')' in an argument list, "
"but found \"%~.*s\". Arguments must be separated by commas, and "
"the entire list must be enclosed in parentheses '( )'. Check for "
"errors and unbalanced parentheses in the argument expression." },
{ TCERR_EXPECTED_SUB_RBRACK,
"expected ']' at end of subscript, but found \"%~.*s\"",
"Expected a right square bracket ']' at the end of the subscript "
"(index) expression, but found \"%~.*s\" instead. A ']' is required "
"to match the '[' at the start of the subscript. Check for errors "
"and unbalanced parentheses in the subscript expression." },
{ TCERR_INVALID_PROP_EXPR,
"expected property name or parenthesized expression after '.', "
"found \"%~.*s\"",
"Expected a property name or a parenthesized expression (which must "
"evaluate at run-time to a property address value) after '.', but "
"found \"%~.*s\", which is not a valid property-valued expression." },
{ TCERR_LIST_MISSING_RBRACK,
"expected ']' or a list element, but found \"%~.*s\"",
"Expected to find a list element expression or a right square "
"bracket ']' ending the list, but found \"%~.*s\" instead. "
"The compiler will assume that this is the end of the list. "
"Please insert the missing ']', or check for errors in the list "
"expressions." },
{ TCERR_LIST_EXTRA_RPAR,
"found extraneous ')' in list; ignored",
"Found an extra right parenthesis ')' where a list element "
"expression or a right square bracket ']' ending the list should be. "
"The compiler will assume that the ')' is extraneous and will "
"ignore it. Please remove the extra ')' or check the list "
"for unbalanced parentheses or other expression errors." },
{ TCERR_LIST_EXPECT_COMMA,
"expected ',' separating list elements, but found \"%~.*s\"",
"A comma ',' must be used to separate each element of a list. "
"The compiler found \"%~.*s\" where a comma should be. Please insert "
"the missing comma between the list elements, or check for an "
"error in the preceding list element expression." },
{ TCERR_CONST_IDX_NOT_INT,
"index value must be an integer in constant list index expression",
"The list index expression has a constant value, but the list index "
"is not a number. A list index must have a numeric value. Check "
"the expression in the square brackets '[ ]' and correct any errors." },
{ TCERR_CONST_IDX_RANGE,
"index value out of range in constant list index expression",
"The list index expression is out of range for the list. The index "
"value must be a number from 1 to the number of elements in the "
"list. Check the expression in the square brackets '[ ]' and "
"correct the value." },
{ TCERR_UNTERM_STRING,
"unterminated string literal: string started with %c%~.*s%c",
"Unterminated string. The string starting with %c%~.*s%c does not have a "
"matching close quote before the end of the file. Please insert the "
"missing quote mark. If the string looks properly terminated, check "
"the previous string (or the previous few strings), since an unbalanced "
"quote mark in an earlier string can sometimes propagate to later "
"strings." },
{ TCERR_EXPECTED_ARG_RPAR,
"expected ')' at end of argument list, but found \"%~.*s\"",
"Expected a right parenthesis ')' at the end of an argument list, "
"but found \"%~.*s\". The compiler is assuming that this is the end "
"of the statement. Please insert the missing parenthesis, or check "
"the argument list for unbalanced parentheses or other errors." },
{ TCERR_EXTRA_RPAR,
"unexpected ')' found - ignored",
"The expression contains an unbalanced right parenthesis ')'. "
"The compiler will ignore the extra ')'. Remove the extra ')', "
"or check the expression for other errors." },
{ TCERR_EXTRA_RBRACK,
"unexpected ']' found - ignored",
"The expression contains an unbalanced right square bracket ']'. "
"The compiler will ignore the extra ']'. Remove the extra ']', "
"or check the expression for other errors." },
{ TCERR_EXPECTED_OPERAND,
"expected an operand, but found \"%~.*s\"",
"The expression is missing an operand value - the compiler found "
"\"%~.*s\" instead of a valid operand. Please check the expression and "
"correct the error." },
{ TCERR_PROPSET_REQ_STR,
"expected property name pattern string after 'propertyset' - "
"found \"%~.*s\"",
"A property name pattern string, enclosed in single quotes, is "
"required after the 'propertyset' keyword, but the compiler found "
"\"%~.*s\" instead. Add the missing pattern string." },
{ TCERR_INH_CLASS_SYNTAX,
"\"inherited superclass\" syntax - expected '.', found \"%~.*s\"",
"Invalid syntax in \"inherited class\" expression. The class name "
"must be followed by '.', but the compiler found \"%~.*s\" instead. "
"Check and correct the syntax." },
{ TCERR_UNDEF_SYM,
"undefined symbol \"%~.*s\"",
"The symbol \"%~.*s\" is not defined. Check the spelling of the "
"symbol name, and make sure that the corresponding local variable, "
"object, or function definition is entered correctly. This error "
"could be the result of a syntax error in the original declaration "
"of the symbol; if the declaration has an error, correct that error "
"first, then try recompiling." },
{ TCERR_ASSUME_SYM_PROP,
"undefined symbol \"%~.*s\" - assuming this is a property name",
"The symbol \"%~.*s\" is undefined, but appears from context to be "
"a property name. The compiler is assuming that this is a property. "
"Check the spelling of the symbol. If this assumption is correct, "
"you can avoid this warning by explicitly declaring a value to the "
"property in an object definition rather than in method code." },
{ TCERR_CONST_BINMINUS_INCOMPAT,
"incompatible constant types for two-operand '-' operator",
"The constant types in this expression are not compatible for use "
"with the two-operand '-' operator. You can subtract one number "
"from another, or subtract a value from a list; other combinations "
"are not allowed." },
{ TCERR_REQ_SYM_FORMAL,
"expected a symbol in formal parameter list, but found \"%~.*s\"",
"A symbol name is required for each formal parameter. The compiler "
"found \"%~.*s\" instead of a symbol for the parameter name." },
{ TCERR_REQ_COMMA_FORMAL,
"expected a comma in formal parameter list, but found \"%~.*s\"",
"The formal parameter list is missing a comma between two parameter "
"names - a comma should come before \"%~.*s\" in the parameter list." },
{ TCERR_MISSING_LAST_FORMAL,
"missing parameter name at end of formal parameter list",
"The last parameter name in the formal parameter list is missing. "
"Insert a parameter name before the ')', or remove the extra comma "
"at the end of the list." },
{ TCERR_MISSING_RPAR_FORMAL,
"missing right parenthesis ')' at end of formal parameter list - "
"found \"%~.*s\"",
"The right parenthesis ')' at the end of the formal parameter list "
"is missing. The parenthesis should come before \"%~.*s\". " },
{ TCERR_FORMAL_REDEF,
"formal parameter \"%~.*s\" defined more than once",
"The formal parameter name \"%~.*s\" is defined more than once in the "
"parameter list. Each parameter name can be used only once in the "
"same list. Remove the redundant variable, or change its name." },
{ TCERR_EQ_WITH_METHOD_OBSOLETE,
"'=' is not allowed with a method definition",
"An equals sign '=' is not allowed in a method definition. You can "
"only use '=' when defining a simple value for a property, not to "
"define method code. (TADS 2 used '=' in methods, but this syntax is "
"now obsolete.) Remove the '='." },
{ TCERR_REQ_LBRACE_CODE,
"expected '{' at start of method code body, but found \"%~.*s\"",
"An open brace '{' was expected before a method's program code body, "
"but the compiler found \"%~.*s\" instead." },
{ TCERR_EOF_IN_CODE,
"unexpected end of file in code block - '}' missing",
"The compiler reached the end of the file before the current function "
"or method was finished. A close brace '}' is probably missing - "
"insert the close brace at the end of the function or method." },
{ TCERR_REQ_LPAR_IF,
"expected '(' after \"if\", but found \"%~.*s\"",
"An open parenthesis '(' is required after the keyword \"if\" - "
"the compiler found \"%~.*s\" instead. The compiler will assume "
"that a parenthesis was intended. Please correct the syntax "
"by inserting a parenthesis." },
{ TCERR_MISPLACED_ELSE,
"misplaced \"else\" - no corresponding \"if\" statement",
"This \"else\" clause is invalid because it is not properly associated "
"with an \"if\" statement. Most likely, this is because the group of "
"statements following the \"if\" is not properly enclosed in braces "
"'{ }', or because the braces just before the \"else\" aren't properly "
"balanced, or because there are too many or too few semicolons ';' after "
"the statement following the \"if\" and before the \"else\". Check "
"braces to make sure they're properly balanced, and check the statement "
"or statements before the \"else\" for proper syntax, especially "
"for the correct number of terminating semicolons." },
{ TCERR_MISPLACED_CASE,
"misplaced \"case\" keyword - not in a \"switch\" statement",
"This \"case\" clause is invalid because it is not part of a \"switch\" "
"statement. The most likely cause is that braces before this \"case\" "
"keyword aren't properly balanced. \"case\" labels must be enclosed "
"directly by the \"switch\" - they cannot be enclosed within statements "
"or braces inside the \"switch\". Check code preceding the \"case\" "
"clause for proper syntax and balanced braces." },
{ TCERR_MISPLACED_DEFAULT,
"misplaced \"default\" keyword - not in a \"switch\" statement",
"This \"default\" clause is invalid because it is not part of a "
"\"switch\" statement. The most likely cause is that braces before "
"this \"default\" keyword aren't properly balanced. A \"default\" "
"label must be enclosed directly by the \"switch\" - it cannot be "
"enclosed within a statement or braces within the \"switch\" body. "
"Check code preceding the \"default\" clause for proper syntax "
"and balanced braces." },
{ TCERR_ELLIPSIS_NOT_LAST,
"'...' cannot be followed by additional formal parameters",
"An ellipsis '...' cannot be followed by additional parameters "
"in an argument list. Move the '...' to the end of the parameter "
"list, or remove the extraneous parameters after the ellipsis." },
{ TCERR_LOCAL_REQ_COMMA,
"expected ',' or ';' after local variable, but found \"%~.*s\"",
"The compiler expected a comma ',' or semicolon ';' after a local "
"variable declaration, but found \"%~.*s\" instead. If you're "
"defining an additional variable, add a comma before the additional "
"variable; if not, check for a missing semicolon." },
{ TCERR_LOCAL_REQ_SYM,
"expected symbol name in local variable declaration, but found \"%~.*s\"",
"A symbol name is required in the local variable declaration, "
"but the compiler found \"%~.*s\" instead. Check the syntax "
"and correct the error." },
{ TCERR_FUNC_REQ_SYM,
"expected symbol after 'function', but found \"%~.*s\"",
"A symbol name is required after the 'function' keyword, but the "
"compiler found \"%~.*s\" instead. Check the function definition "
"syntax." },
{ TCERR_REQ_CODE_BODY,
"expected ';', '(', or '{', but found \"%~.*s\"",
"The compiler expected a left parenthesis '(' starting a formal "
"parameter list, a left brace '{' starting a code body, or a semicolon "
"';' terminating the statement, but found \"%~.*s\". Check the function "
"definition syntax." },
{ TCERR_REQ_FUNC_OR_OBJ,
"expected function or object definition, but found \"%~.*s\"",
"The compiler expected a function or object definition, but "
"found \"%~.*s\". Check the syntax, and check for unbalanced "
"braces '{ }' and other syntax errors preceding this line." },
{ TCERR_RET_REQ_EXPR,
"expected ';' or expression after \"return\", but found \"%~.*s\"",
"The \"return\" keyword must be followed by an expression giving the "
"value to return, or by a semicolon ';' if there is no value to "
"return; the compiler found \"%~.*s\" instead. Check the syntax, and "
"insert the missing semicolon or expression as appropriate." },
{ TCERR_UNREACHABLE_CODE,
"unreachable statement",
"This statement cannot be reached, because the previous statement "
"returns or throws an exception. This code will never be executed. "
"Check the logic to determine if the code is necessary; if not, "
"remove the code. If the code is necessary, you must determine "
"why the code is unreachable and correct the program logic." },
{ TCERR_RET_VAL_AND_VOID,
"code has \"return\" statements both with and without values",
"This code has \"return\" statements both with and without values. "
"A function or method's \"return\" statements should consistently "
"return values or not; these should not be mixed in a single "
"function or method, because callers will not have predictable "
"results when using the function's return value." },
{ TCERR_RET_VAL_AND_IMP_VOID,
"code has \"return\" with value but also falls off end",
"This code has one or more \"return\" statements that explicitly "
"return a value from the function, but also \"falls off\" the end "
"of the function without a \"return\" statement, which will result "
"in a return without a value. The last statement in the function "
"or method should be a \"return\" with a value, for consistency "
"with the other \"return\" statements." },
{ TCERR_REQ_INTRINS_NAME,
"expected function set name string after \"intrinsic\", "
"but found \"%~.*s\"",
"The \"intrinsic\" keyword must be followed by the global name of the "
"function set, enclosed in single-quotes, but the compiler found "
"\"%~.*s\" instead. Check the \"intrinsic\" statement syntax." },
{ TCERR_REQ_INTRINS_LBRACE,
"expected '{' after intrinsic name, but found \"%~.*s\"",
"The function set listing for an \"intrinsic\" statement must be "
"closed in braces '{ }'. The compiler found \"%~.*s\" after the "
"function set name, where the open brace '{' should be. Check the "
"syntax." },
{ TCERR_EOF_IN_INTRINS,
"end of file in \"intrinsic\" list - '}' is probably missing",
"The compiler reached the end of the file while still scanning "
"an \"intrinsic\" statement's function set listing. The closing "
"brace '}' of the function set list is probably missing; check "
"for the missing brace." },
{ TCERR_REQ_INTRINS_LPAR,
"expected '(' after function name in intrinsic list, but found \"%~.*s\"",
"An open parenthesis '(' is required after the name of a function "
"in an intrinsic function list, but the compiler found \"%~.*s\" "
"instead. Check the syntax and insert the missing parenthesis." },
{ TCERR_REQ_INTRINS_SYM,
"expected function name in intrinsic list, but found \"%~.*s\"",
"The compiler expected the name of a function in the intrinsic "
"function list, but found \"%~.*s\" instead. Check the syntax of "
"the statement, and check for unbalanced parentheses and braces." },
{ TCERR_REQ_FOR_LPAR,
"expected '(' after \"for\", but found \"%~.*s\"",