Mercurial > projects > dang
comparison src/basic/Messages.d @ 206:d3c148ca429b
Major moving of files. all src now goes into src, all docs in docs.
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Tue, 12 Aug 2008 18:14:56 +0200 |
parents | |
children | e0551773a005 |
comparison
equal
deleted
inserted
replaced
205:8387cbaa85ab | 206:d3c148ca429b |
---|---|
1 module basic.Messages; | |
2 | |
3 enum : uint | |
4 { | |
5 // Lex | |
6 InvalidSymbol, | |
7 InvalidIlligaleType, | |
8 UnexpectedEOFBlock, | |
9 OnlyOneDotFloating, | |
10 OnlyOneEFloating, | |
11 | |
12 // Parse | |
13 UnexpectedTokMulti, | |
14 UnexpectedTokSingle, | |
15 UnexpectedTok, | |
16 CaseValueMustBeInt, | |
17 UnexpectedBeginStmt, | |
18 UnexpectedTokType, | |
19 ExpectedIdAfterDot, | |
20 ExpectedExp, | |
21 ExpectedCastType, | |
22 InvalidDeclType, | |
23 InvalidType, | |
24 // - imports/module | |
25 ExpectedIdAfterPackage, | |
26 RenameMustBeSingleIdent, | |
27 | |
28 | |
29 // Imports | |
30 CannotFindModule, | |
31 } | |
32 | |
33 enum MessageType | |
34 { | |
35 Warning, | |
36 Error, | |
37 } | |
38 | |
39 MessageEntry[uint] Messages; | |
40 | |
41 struct MessageEntry | |
42 { | |
43 MessageType type; | |
44 char[] message; | |
45 } | |
46 | |
47 private alias MessageType.Error Err; | |
48 private alias MessageType.Warning War; | |
49 private alias MessageEntry E; | |
50 static this() | |
51 { | |
52 Messages = [ | |
53 UnexpectedEOFBlock : E(Err, "Unexpected end of file. Unclosed comment block"), | |
54 InvalidSymbol : E(Err, "Read invalid symbol: '%0'"), | |
55 OnlyOneDotFloating : E(Err, "Only one '.' is allowed in an floating number"), | |
56 OnlyOneEFloating : E(Err, "Only one E is allowed in an floating number"), | |
57 | |
58 UnexpectedTokMulti : E(Err, "Unexpected token, got %0 expected one of %1"), | |
59 UnexpectedTokSingle : E(Err, "Unexpected token, got %0 expected %1"), | |
60 UnexpectedTok : E(Err, "Unexpected token %0"), | |
61 CaseValueMustBeInt : E(Err, "Cases can only be integer literals"), | |
62 UnexpectedBeginStmt : E(Err, "Unexpected begining of statement."), | |
63 UnexpectedTokType : E(Err, "Unexpected token in Type parsing. Got %0"), | |
64 ExpectedIdAfterDot : E(Err, "Expected identifier after '.'"), | |
65 ExpectedExp : E(Err, "Expected expression"), | |
66 ExpectedCastType : E(Err, "Expected cast type"), | |
67 InvalidDeclType : E(Err, "Invalid declaration type"), | |
68 InvalidType : E(Err, "Invalid type"), | |
69 ExpectedIdAfterPackage : E(Err, "Identifier expected following package"), | |
70 | |
71 CannotFindModule : E(Err, "Cannot find module '%0'") | |
72 ]; | |
73 } | |
74 |