annotate trunk/src/Messages.d @ 86:0459c902a370

- Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions. - Added methods errorIfNot(), requireNext() and require(). - Added error msg MID.ExpectedButFound.
author aziz
date Thu, 05 Jul 2007 18:45:00 +0000
parents aa1ea2548dd9
children f3c6c15961bb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
54
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
1 /++
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
2 Author: Aziz Köksal
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
3 License: GPL2
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
4 +/
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
5 module Messages;
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
6
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
7 /// Index into table of error messages.
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
8 enum MID
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
9 {
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
10 InvalidUnicodeCharacter,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
11 InvalidUTF8Sequence,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
12 // ''
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
13 UnterminatedCharacterLiteral,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
14 EmptyCharacterLiteral,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
15 // #line
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
16 ExpectedIdentifierSTLine,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
17 ExpectedNormalStringLiteral,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
18 ExpectedNumberAfterSTLine,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
19 NewlineInSpecialToken,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
20 UnterminatedSpecialToken,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
21 // ""
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
22 UnterminatedString,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
23 // x""
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
24 NonHexCharInHexString,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
25 OddNumberOfDigitsInHexString,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
26 UnterminatedHexString,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
27 // /* */ /+ +/
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
28 UnterminatedBlockComment,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
29 UnterminatedNestedComment,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
30 // `` r""
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
31 UnterminatedRawString,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
32 UnterminatedBackQuoteString,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
33 // \x \u \U
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
34 UndefinedEscapeSequence,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
35 InsufficientHexDigits,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
36 // \&[a-zA-Z][a-zA-Z0-9]+;
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
37 UnterminatedHTMLEntity,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
38 InvalidBeginHTMLEntity,
56
63af7ddf52e1 - Started properly implementing number scanner. Added stub for real numbers.
aziz
parents: 54
diff changeset
39 // integer overflows
58
50bb7fc9db44 - The types of integers are recognized now.
aziz
parents: 56
diff changeset
40 OverflowDecimalSign,
56
63af7ddf52e1 - Started properly implementing number scanner. Added stub for real numbers.
aziz
parents: 54
diff changeset
41 OverflowDecimalNumber,
63af7ddf52e1 - Started properly implementing number scanner. Added stub for real numbers.
aziz
parents: 54
diff changeset
42 OverflowHexNumber,
63af7ddf52e1 - Started properly implementing number scanner. Added stub for real numbers.
aziz
parents: 54
diff changeset
43 OverflowBinaryNumber,
63af7ddf52e1 - Started properly implementing number scanner. Added stub for real numbers.
aziz
parents: 54
diff changeset
44 OverflowOctalNumber,
63
c29229fbf2f7 - Recognizing floats that start with a dot.
aziz
parents: 62
diff changeset
45 OverflowFloatNumber,
c29229fbf2f7 - Recognizing floats that start with a dot.
aziz
parents: 62
diff changeset
46 OctalNumberHasDecimals,
59
3e594725899a - Issuing error when no digits were found in hex and binary numbers.
aziz
parents: 58
diff changeset
47 NoDigitsInHexNumber,
3e594725899a - Issuing error when no digits were found in hex and binary numbers.
aziz
parents: 58
diff changeset
48 NoDigitsInBinNumber,
62
96af5653acef - Fixed loop of hex number scanner. Moved checks under the switch block.
aziz
parents: 59
diff changeset
49 HexFloatExponentRequired,
96af5653acef - Fixed loop of hex number scanner. Moved checks under the switch block.
aziz
parents: 59
diff changeset
50 HexFloatMissingExpDigits,
63
c29229fbf2f7 - Recognizing floats that start with a dot.
aziz
parents: 62
diff changeset
51 FloatExponentDigitExpected,
86
0459c902a370 - Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents: 81
diff changeset
52
0459c902a370 - Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents: 81
diff changeset
53 // Parser messages
0459c902a370 - Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents: 81
diff changeset
54 ExpectedButFound,
54
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
55 }
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
56
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
57 string[] messages = [
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
58 "invalid Unicode character.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
59 "invalid UTF-8 sequence.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
60 // ''
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
61 "unterminated character literal.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
62 "empty character literal.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
63 // #line
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
64 "expected 'line' after '#'.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
65 `the filespec must be defined in a double quote string literal (e.g. "filespec".)`,
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
66 "positive integer expected after #line",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
67 "newline not allowed inside special token.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
68 "expected a terminating newline after special token.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
69 // ""
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
70 "unterminated string literal.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
71 // x""
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
72 "non-hex character '{1}' found in hex string.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
73 "odd number of hex digits in hex string.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
74 "unterminated hex string.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
75 // /* */ /+ +/
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
76 "unterminated block comment (/* */).",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
77 "unterminated nested comment (/+ +/).",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
78 // `` r""
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
79 "unterminated raw string.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
80 "unterminated back quote string.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
81 // \x \u \U
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
82 "found undefined escape sequence.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
83 "insufficient number of hex digits in escape sequence.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
84 // \&[a-zA-Z][a-zA-Z0-9]+;
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
85 "unterminated html entity.",
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
86 "html entities must begin with a letter.",
56
63af7ddf52e1 - Started properly implementing number scanner. Added stub for real numbers.
aziz
parents: 54
diff changeset
87 // integer overflows
58
50bb7fc9db44 - The types of integers are recognized now.
aziz
parents: 56
diff changeset
88 "decimal number overflows sign bit.",
56
63af7ddf52e1 - Started properly implementing number scanner. Added stub for real numbers.
aziz
parents: 54
diff changeset
89 "overflow in decimal number.",
63af7ddf52e1 - Started properly implementing number scanner. Added stub for real numbers.
aziz
parents: 54
diff changeset
90 "overflow in hexadecimal number.",
63af7ddf52e1 - Started properly implementing number scanner. Added stub for real numbers.
aziz
parents: 54
diff changeset
91 "overflow in binary number.",
63af7ddf52e1 - Started properly implementing number scanner. Added stub for real numbers.
aziz
parents: 54
diff changeset
92 "overflow in octal number.",
63
c29229fbf2f7 - Recognizing floats that start with a dot.
aziz
parents: 62
diff changeset
93 "overflow in float number.",
81
aa1ea2548dd9 - Fixed parseExpression() method.
aziz
parents: 63
diff changeset
94 "digits 8 and 9 are not allowed in octal numbers.",
59
3e594725899a - Issuing error when no digits were found in hex and binary numbers.
aziz
parents: 58
diff changeset
95 "invalid hex number; at least one hex digit expected.",
3e594725899a - Issuing error when no digits were found in hex and binary numbers.
aziz
parents: 58
diff changeset
96 "invalid binary number; at least one binary digit expected.",
62
96af5653acef - Fixed loop of hex number scanner. Moved checks under the switch block.
aziz
parents: 59
diff changeset
97 "the exponent of a hexadecimal float number is required.",
96af5653acef - Fixed loop of hex number scanner. Moved checks under the switch block.
aziz
parents: 59
diff changeset
98 "missing decimal digits in hexadecimal float exponent.",
63
c29229fbf2f7 - Recognizing floats that start with a dot.
aziz
parents: 62
diff changeset
99 "exponents have to start with a digit.",
86
0459c902a370 - Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents: 81
diff changeset
100
0459c902a370 - Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents: 81
diff changeset
101 // Parser messages
0459c902a370 - Added code for parsing Assert-, Mixin-, Import-, Typeid- and TypeDotIdExpressions.
aziz
parents: 81
diff changeset
102 "expected '{1}', but found '{2}'.",
54
e55bd2270f94 - Relocated messages table to a separate module.
aziz
parents:
diff changeset
103 ];