summary refs log tree commit diff stats
path: root/nim/msgs.pas
diff options
context:
space:
mode:
Diffstat (limited to 'nim/msgs.pas')
-rw-r--r--nim/msgs.pas75
1 files changed, 52 insertions, 23 deletions
diff --git a/nim/msgs.pas b/nim/msgs.pas
index 6f4f8225e..8112b8df7 100644
--- a/nim/msgs.pas
+++ b/nim/msgs.pas
@@ -74,10 +74,6 @@ type
     errTokenExpected,
     errStringAfterIncludeExpected,
     errRecursiveInclude,
-    errAtIfExpected,
-    errAtIfExpectedBeforeElse,
-    errAtIfExpectedBeforeElif,
-    errAtEndExpected,
     errOnOrOffExpected,
     errNoneSpeedOrSizeExpected,
     errInvalidPragma,
@@ -186,7 +182,7 @@ type
     errSizeTooBig,
     errSetTooBig,
     errBaseTypeMustBeOrdinal,
-    errInheritanceOnlyWithObjects,
+    errInheritanceOnlyWithNonFinalObjects,
     errInheritanceOnlyWithEnums,
     errIllegalRecursionInTypeX,
     errCannotInstantiateX,
@@ -267,6 +263,20 @@ type
     errWhitespaceExpected,
     errXisNoValidIndexFile,
     errCannotRenderX,
+    errVarVarTypeNotAllowed,
+    errIsExpectsTwoArguments,
+    errIsExpectsObjectTypes,
+    errXcanNeverBeOfThisSubtype,
+    errTooManyIterations,
+    errCannotInterpretNodeX,
+    errFieldXNotFound,
+    errInvalidConversionFromTypeX,
+    errAssertionFailed,
+    errCannotGenerateCodeForX,
+    errXNeedsReturnType,
+    errXRequiresOneArgument,
+    errUnhandledExceptionX,
+    errCyclicTree,
     errUser,
     warnCannotOpenFile,
     warnOctalEscape,
@@ -291,6 +301,8 @@ type
     hintMo2FileInvalid,
     hintModuleHasChanged,
     hintCannotOpenMo2File,
+    hintQuitCalled,
+    hintProcessing,
     hintUser);
 
 const
@@ -310,7 +322,7 @@ const
     'invalid token: $1',
     'line too long',
     '$1 is not a valid number',
-    '$1 is too large or too small',
+    'number $1 out of valid range',
     '\n not allowed in character literal',
     'closing '']'' expected, but end of file reached',
     'missing final ''',
@@ -319,10 +331,6 @@ const
     '''$1'' expected',
     'string after ''include'' expected',
     'recursive include file: ''$1''',
-    '''@if'' expected',
-    '''@if'' expected before ''@else''',
-    '''@if'' expected before ''@elif''',
-    '''@end'' expected',
     '''on'' or ''off'' expected',
     '''none'', ''speed'' or ''size'' expected',
     'invalid pragma',
@@ -431,12 +439,12 @@ const
     'computing the type''s size produced an overflow',
     'set is too large',
     'base type of a set must be an ordinal',
-    'inheritance only works with an object',
+    'inheritance only works non-final objects',
     'inheritance only works with an enum',
     'illegal recursion in type ''$1''',
     'cannot instantiate: ''$1''',
     'expression has no address',
-    'to an out parameter a variable needs to be passed',
+    'for a ''var'' type a variable needs to be passed',
     'type mismatch',
     'type mismatch: got (',
     'but expected one of: ',
@@ -512,6 +520,20 @@ const
     'whitespace expected, got ''$1''',
     '''$1'' is no valid index file',
     'cannot render reStructuredText element ''$1''',
+    'type ''var var'' is not allowed',
+    '''is'' expects two arguments',
+    '''is'' expects object types',
+    '''$1'' can never be of this subtype',
+    'interpretation requires too many iterations',
+    'cannot interpret node kind ''$1''',
+    'field ''$1'' cannot be found',
+    'invalid conversion from type ''$1''',
+    'assertion failed',
+    'cannot generate code for ''$1''',
+    'converter needs return type',
+    'converter requires one parameter',
+    'unhandled exception: $1',
+    'macro returned a cyclic abstract syntax tree',
     '$1',
     'cannot open ''$1'' [CannotOpenFile]',
     'octal escape sequences do not exist; leading zero is ignored [OctalEscape]',
@@ -536,6 +558,8 @@ const
     'mo2 file ''$1'' is invalid [Mo2FileInvalid]',
     'module ''$1'' has been changed [ModuleHasChanged]',
     'mo2 file ''$1'' does not exist [CannotOpenMo2File]',
+    'quit() called [QuitCalled]',
+    'processing [Processing]',
     '$1 [User]'
   );
 const
@@ -556,7 +580,7 @@ const
     'User'
   );
 const
-  HintsToStr: array [0..9] of string = (
+  HintsToStr: array [0..11] of string = (
     'Success',
     'LineTooLong',
     'XDeclaredButNotUsed',
@@ -566,6 +590,8 @@ const
     'Mo2FileInvalid',
     'ModuleHasChanged',
     'CannotOpenMo2File',
+    'QuitCalled',
+    'Processing',
     'User'
   );
 //[[[end]]]
@@ -593,12 +619,7 @@ type
     fileIndex: int32;
   end;
 
-const
-  UnknownLineInfo: TLineInfo = (
-    line: -1;
-    col: -1;
-    fileIndex: -1;
-  );
+function UnknownLineInfo(): TLineInfo;
 
 var
   gNotes: TNoteKinds = [low(TNoteKind)..high(TNoteKind)];
@@ -649,6 +670,13 @@ procedure popInfoContext;
 
 implementation
 
+function UnknownLineInfo(): TLineInfo;
+begin
+  result.line := -1;
+  result.col := -1;
+  result.fileIndex := -1;
+end;
+
 {@ignore}
 var
   filenames: array of string;
@@ -781,13 +809,14 @@ end;
 
 procedure handleError(const msg: TMsgKind);
 begin
-  if (msg >= fatalMin) and (msg <= fatalMax) then begin 
-    assert(false); halt(1) 
+  if (msg >= fatalMin) and (msg <= fatalMax) then begin
+    if optVerbose in gGlobalOptions then assert(false);
+    halt(1)
   end;
   if (msg >= errMin) and (msg <= errMax) then begin
     inc(gErrorCounter);
     if gErrorCounter >= gErrorMax then begin
-      assert(false); // stack trace for debugging
+      if optVerbose in gGlobalOptions then assert(false);
       halt(1) // one error stops the compiler
     end
   end
@@ -797,7 +826,7 @@ procedure writeContext;
 var
   i: int;
 begin
-  for i := length(msgContext)-1 downto 0 do begin
+  for i := 0 to length(msgContext)-1 do begin
     MessageOut(Format(posErrorFormat, [toFilename(msgContext[i]),
                              coordToStr(msgContext[i].line),
                              coordToStr(msgContext[i].col),
rumpf_a@web.de> 2013-10-25 13:30:34 +0200 computed goto now works; some progress on the new VM' href='/ahoang/Nim/commit/compiler/vmdeps.nim?h=devel&id=6ea538cec3f2da832873252d0ec3810b9dbfede4'>6ea538cec ^
752052e90 ^


1ba785dd7 ^
752052e90 ^








7324ed7f1 ^


335c19c86 ^
7324ed7f1 ^

752052e90 ^





























f9a3de984 ^





752052e90 ^

















335c19c86 ^
752052e90 ^






























9700298d0 ^


752052e90 ^












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