2
0
Эх сурвалжийг харах

Removed obsolete support for error codes in diagnostics

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8150 8c9fc860-2736-0410-a75d-ab315db34111
negelef 7 жил өмнө
parent
commit
0ed74d6258

+ 6 - 6
source/Compiler.Mod

@@ -52,7 +52,7 @@ TYPE
 		replacement := NIL;
 		reader := Basic.GetFileReader(filename);
 		IF reader = NIL THEN
-			diagnostics.Error (filename, Diagnostics.Invalid, Diagnostics.Invalid, "failed to open");
+			diagnostics.Error (filename, Diagnostics.Invalid, "failed to open");
 		ELSE
 
 			scanner := Scanner.NewScanner(filename, reader, 0, diagnostics);
@@ -111,7 +111,7 @@ TYPE
 			Strings.Append (message, msg);
 			IF error THEN
 				IF diagnostics # NIL THEN
-					diagnostics.Error (source, Diagnostics.Invalid, Diagnostics.Invalid, message);
+					diagnostics.Error (source, Diagnostics.Invalid, message);
 				END;
 			ELSE
 				IF (log # NIL) & ~(Silent IN options.flags) & ~(FindPC IN options.flags) THEN
@@ -272,7 +272,7 @@ TYPE
 		PROCEDURE Error(CONST error: ARRAY OF CHAR);
 		BEGIN
 			IF diagnostics # NIL THEN
-				diagnostics.Error("",Diagnostics.Invalid,Diagnostics.Invalid,error);
+				diagnostics.Error("",Diagnostics.Invalid,error);
 			END;
 		END Error;
 
@@ -467,7 +467,7 @@ TYPE
 				reader := Basic.GetFileReader(filename);
 
 				IF reader = NIL THEN
-					diagnostics.Error (filename, Diagnostics.Invalid, Diagnostics.Invalid, "failed to open"); error := TRUE;
+					diagnostics.Error (filename, Diagnostics.Invalid, "failed to open"); error := TRUE;
 				ELSE
 					error := ~Modules(filename, reader, 0, diagnostics,context.out, options,  importCache);
 				END;
@@ -483,7 +483,7 @@ TYPE
 				WHILE replacement # NIL DO
 					IF ~replacement.used THEN
 						name := replacement.name;
-						diagnostics.Warning(name,  Diagnostics.Invalid, Diagnostics.Invalid, " unused replacement.");
+						diagnostics.Warning(name,  Diagnostics.Invalid, " unused replacement.");
 					END;
 					replacement := replacement.next;
 				END;
@@ -506,7 +506,7 @@ TYPE
 		IF GetOptions(context.arg,context.error,diagnostics,options) THEN
 
 			IF reader = NIL THEN
-				diagnostics.Error (filename, Diagnostics.Invalid, Diagnostics.Invalid, "failed to open"); error := TRUE;
+				diagnostics.Error (filename, Diagnostics.Invalid, "failed to open"); error := TRUE;
 			ELSE
 				error := ~Modules(filename, reader, 0, diagnostics, context.out, options, importCache);
 			END;

+ 3 - 3
source/CompilerInterface.Mod

@@ -41,12 +41,12 @@ TYPE
 			IF (compileText # NIL) THEN
 				compileText(t, source, pos, pc, opt, log, diagnostics, error);
 			ELSIF (diagnostics # NIL) THEN
-				diagnostics.Error(source, Diagnostics.Invalid, Diagnostics.Invalid, "Text compile procedure not set");
+				diagnostics.Error(source, Diagnostics.Invalid, "Text compile procedure not set");
 			END;
 		FINALLY
 			IF trap THEN (* trap will be set in case a trap occurs in the block above *)
 				error := TRUE;
-				diagnostics.Error(source, Diagnostics.Invalid, Diagnostics.Invalid, "COMPILER TRAPPED");
+				diagnostics.Error(source, Diagnostics.Invalid, "COMPILER TRAPPED");
 				log.String("COMPILER TRAPPED!!!"); log.Update;
 			END;
 		END CompileText;
@@ -174,4 +174,4 @@ END CompilerInterface.
 
 CompilerInterface.Show ~
 
-System.Free CompilerInterface ~
+System.Free CompilerInterface ~

+ 22 - 28
source/Diagnostics.Mod

@@ -3,7 +3,7 @@ MODULE Diagnostics; (** AUTHOR "staubesv"; PURPOSE "Generic diagnostics reportin
 IMPORT Streams;
 
 CONST
-	(** Indicate that a position or an errorcode is not valid *)
+	(** Indicate that a position is not valid *)
 	Invalid* = -1;
 
 	(** Entry types *)
@@ -20,13 +20,13 @@ TYPE
 
 	Diagnostics* = OBJECT
 
-		PROCEDURE Error*(CONST source : ARRAY OF CHAR; position : Streams.Position; errorCode : WORD; CONST message : ARRAY OF CHAR);
+		PROCEDURE Error*(CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
 		END Error;
 
-		PROCEDURE Warning*(CONST source : ARRAY OF CHAR; position : Streams.Position; errorCode : WORD; CONST message : ARRAY OF CHAR);
+		PROCEDURE Warning*(CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
 		END Warning;
 
-		PROCEDURE Information*(CONST source : ARRAY OF CHAR; position : Streams.Position; errorCode : WORD; CONST message : ARRAY OF CHAR);
+		PROCEDURE Information*(CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
 		END Information;
 
 	END Diagnostics;
@@ -37,7 +37,6 @@ TYPE
 		type*: WORD;
 		source*: ARRAY 128 OF CHAR;
 		position*: Streams.Position;
-		errorCode*: WORD;
 		message*: ARRAY 256 OF CHAR;
 		next*: Entry;
 	END;
@@ -59,19 +58,19 @@ TYPE
 
 		nofMessages- : SIZE;
 
-		PROCEDURE Error*(CONST source : ARRAY OF CHAR; position : Streams.Position; errorCode : WORD; CONST message : ARRAY OF CHAR);
+		PROCEDURE Error*(CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
 		BEGIN {EXCLUSIVE}
-			InsertSorted(TypeError, source, position, errorCode, message, nofErrors)
+			InsertSorted(TypeError, source, position, message, nofErrors)
 		END Error;
 
-		PROCEDURE Warning*(CONST source : ARRAY OF CHAR; position : Streams.Position; errorCode : WORD; CONST message : ARRAY OF CHAR);
+		PROCEDURE Warning*(CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
 		BEGIN {EXCLUSIVE}
-			InsertSorted(TypeWarning, source, position, errorCode, message, nofWarnings);
+			InsertSorted(TypeWarning, source, position, message, nofWarnings);
 		END Warning;
 
-		PROCEDURE Information*(CONST source : ARRAY OF CHAR; position : Streams.Position; errorCode : WORD; CONST message : ARRAY OF CHAR);
+		PROCEDURE Information*(CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
 		BEGIN {EXCLUSIVE}
-			InsertSorted(TypeInformation, source, position, errorCode, message, nofInformations);
+			InsertSorted(TypeInformation, source, position, message, nofInformations);
 		END Information;
 
 		PROCEDURE ToStream*(w : Streams.Writer; mask : SET);
@@ -81,7 +80,7 @@ TYPE
 			entry := entries;
 			WHILE (entry # NIL) DO
 				IF (entry.type IN mask) THEN
-					Print (w, entry.source, entry.position, entry.errorCode, entry.type, entry.message);
+					Print (w, entry.source, entry.position, entry.type, entry.message);
 				END;
 				entry := entry.next;
 			END;
@@ -121,26 +120,25 @@ TYPE
 			RETURN result;
 		END GetEntries;
 
-		PROCEDURE InsertSorted(type: WORD; CONST source : ARRAY OF CHAR; position : Streams.Position; errorCode : WORD; CONST message : ARRAY OF CHAR; VAR counter: SIZE);
+		PROCEDURE InsertSorted(type: WORD; CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR; VAR counter: SIZE);
 		VAR prev, entry : Entry;
 		BEGIN
 			entry := entries; prev := NIL;
 			WHILE (entry # NIL) & (entry.position <= position) DO prev := entry; entry := entry.next END;
-			IF (entry = NIL) OR (entry.type # type) OR (entry.position # position) OR (entry.errorCode # errorCode) OR (entry.message # message) THEN
+			IF (entry = NIL) OR (entry.type # type) OR (entry.position # position) OR (entry.message # message) THEN
 				INC(nofMessages); INC (counter);
-				entry := NewEntry (type, source, position, errorCode, message, entry);
+				entry := NewEntry (type, source, position, message, entry);
 				IF prev = NIL THEN entries := entry ELSE prev.next := entry END
 			END
 		END InsertSorted;
 
-		PROCEDURE NewEntry*(type: WORD; CONST source : ARRAY OF CHAR; position : Streams.Position; errorCode : WORD; CONST message : ARRAY OF CHAR; next: Entry) : Entry;
+		PROCEDURE NewEntry*(type: WORD; CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR; next: Entry) : Entry;
 		VAR entry : Entry;
 		BEGIN
 			NEW(entry);
 			entry.type := type;
 			COPY (source, entry.source);
 			entry.position := position;
-			entry.errorCode := errorCode;
 			COPY (message, entry.message);
 			entry.next := next;
 			RETURN entry;
@@ -160,21 +158,21 @@ TYPE
 			writer := w;
 		END Init;
 
-		PROCEDURE Error* (CONST source : ARRAY OF CHAR; position : Streams.Position; errorCode : WORD; CONST message : ARRAY OF CHAR);
-		BEGIN Print (writer, source, position, errorCode, TypeError, message);
+		PROCEDURE Error* (CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
+		BEGIN Print (writer, source, position, TypeError, message);
 		END Error;
 
-		PROCEDURE Warning* (CONST source : ARRAY OF CHAR; position : Streams.Position; errorCode : WORD; CONST message : ARRAY OF CHAR);
-		BEGIN Print (writer, source, position, errorCode, TypeWarning, message);
+		PROCEDURE Warning* (CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
+		BEGIN Print (writer, source, position, TypeWarning, message);
 		END Warning;
 
-		PROCEDURE Information* (CONST source : ARRAY OF CHAR; position : Streams.Position; errorCode : WORD; CONST message : ARRAY OF CHAR);
-		BEGIN Print (writer, source, position, errorCode, TypeInformation, message);
+		PROCEDURE Information* (CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
+		BEGIN Print (writer, source, position, TypeInformation, message);
 		END Information;
 
 	END StreamDiagnostics;
 
-PROCEDURE Print (w: Streams.Writer; CONST source : ARRAY OF CHAR; position: Streams.Position; errorCode: WORD; type: WORD; CONST message: ARRAY OF CHAR);
+PROCEDURE Print (w: Streams.Writer; CONST source : ARRAY OF CHAR; position: Streams.Position; type: WORD; CONST message: ARRAY OF CHAR);
 BEGIN
 	w.Char(Tab);
 	IF (source # "") THEN w.String (source); END;
@@ -185,10 +183,6 @@ BEGIN
 	ELSIF (type = TypeError) THEN
 		w.String("error");
 	END;
-	IF (errorCode # Invalid) THEN
-		IF (type # TypeInformation) THEN w.Char (' ') END;
-		w.Int(errorCode, 0);
-	END;
 	IF (type # TypeInformation) THEN w.String(": ") END;
 	w.String(message); w.Ln;
 	w.Update;

+ 7 - 11
source/FoxA2Interface.Mod

@@ -87,22 +87,22 @@ TYPE
 			writer := w;
 		END Init;
 
-		PROCEDURE Error* (CONST source : ARRAY OF CHAR; position, errorCode : LONGINT; CONST message : ARRAY OF CHAR);
-		BEGIN Print (writer, source, position, errorCode, Diagnostics.TypeError, message);
+		PROCEDURE Error* (CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
+		BEGIN Print (writer, source, position, Diagnostics.TypeError, message);
 		END Error;
 
-		PROCEDURE Warning* (CONST source : ARRAY OF CHAR; position, errorCode : LONGINT; CONST message : ARRAY OF CHAR);
-		BEGIN Print (writer, source, position, errorCode, Diagnostics.TypeWarning, message);
+		PROCEDURE Warning* (CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
+		BEGIN Print (writer, source, position, Diagnostics.TypeWarning, message);
 		END Warning;
 
-		PROCEDURE Information* (CONST source : ARRAY OF CHAR; position, errorCode : LONGINT; CONST message : ARRAY OF CHAR);
-		BEGIN Print (writer, source, position, errorCode, Diagnostics.TypeInformation, message);
+		PROCEDURE Information* (CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
+		BEGIN Print (writer, source, position, Diagnostics.TypeInformation, message);
 		END Information;
 
 	END StreamDiagnostics;
 
 
-	PROCEDURE Print (w: Streams.Writer; CONST source : ARRAY OF CHAR; position, errorCode, type: LONGINT; CONST message: ARRAY OF CHAR);
+	PROCEDURE Print (w: Streams.Writer; CONST source : ARRAY OF CHAR; position: Streams.Position; type: WORD; CONST message: ARRAY OF CHAR);
 	VAR attributes: Texts.Attributes;
 	BEGIN
 		IF w IS TextUtilities.TextWriter THEN
@@ -125,10 +125,6 @@ TYPE
 			w.String("error");
 		ELSE
 		END;
-		IF (errorCode # Diagnostics.Invalid) THEN
-			IF (type # Diagnostics.TypeInformation) THEN w.Char (' ') END;
-			w.Int(errorCode, 0);
-		END;
 		IF (type # Diagnostics.TypeInformation) THEN w.String(": ") END;
 		w.String(message); w.Ln;
 		w.Update;

+ 2 - 2
source/FoxActiveCells.Mod

@@ -1449,7 +1449,7 @@ TYPE
 				IF log # NIL THEN log.String(msg); log.Ln; END;
 				RETURN TRUE
 			ELSE
-				diagnostics.Error(fileName,Diagnostics.Invalid, Diagnostics.Invalid,"could not generate file");
+				diagnostics.Error(fileName,Diagnostics.Invalid, "could not generate file");
 				IF TraceError THEN HALT(100) ELSE RETURN FALSE END
 			END;
 		END Emit;
@@ -1832,4 +1832,4 @@ FoxActiveCells.ReadSpecification Test.spec ~
 FSTools.CopyFiles TL.spec => Test.spec ~
 FoxActiveCells.CompareSpecification Test TL ~~
 
-System.FreeDownTo FoxActiveCells ~
+System.FreeDownTo FoxActiveCells ~

+ 9 - 10
source/FoxBasic.Mod

@@ -1648,32 +1648,31 @@ TYPE
 			SELF.diagnostics := diagnostics
 		END InitDiagnostics;
 
-		PROCEDURE Error*(CONST source: ARRAY OF CHAR; position, errorCode : LONGINT; CONST message : ARRAY OF CHAR);
+		PROCEDURE Error*(CONST source: ARRAY OF CHAR; position: Streams.Position; CONST message : ARRAY OF CHAR);
 		BEGIN
 			IF diagnostics # NIL THEN
-				diagnostics.Error(source,position,errorCode,message);
+				diagnostics.Error(source,position,message);
 			END;
 			D.Ln;
 			D.String(" ---------------------- TRACE for COMPILER ERROR  < ");
 			D.String(source);
 			IF position # Diagnostics.Invalid THEN D.String("@"); D.Int(position,1) END;
-			IF errorCode # Diagnostics.Invalid THEN D.String(" "); D.Int(errorCode,1); END;
 			D.String(" "); D.String(message);
 			D.String(" > ---------------------- ");
 			D.TraceBack
 		END Error;
 
-		PROCEDURE Warning*(CONST source : ARRAY OF CHAR; position, errorCode : LONGINT; CONST message : ARRAY OF CHAR);
+		PROCEDURE Warning*(CONST source : ARRAY OF CHAR; position: Streams.Position; CONST message : ARRAY OF CHAR);
 		BEGIN
 			IF diagnostics # NIL THEN
-				diagnostics.Warning(source,position,errorCode,message);
+				diagnostics.Warning(source,position,message);
 			END;
 		END Warning;
 
-		PROCEDURE Information*(CONST source : ARRAY OF CHAR; position, errorCode : LONGINT; CONST message : ARRAY OF CHAR);
+		PROCEDURE Information*(CONST source : ARRAY OF CHAR; position: Streams.Position; CONST message : ARRAY OF CHAR);
 		BEGIN
 			IF diagnostics # NIL THEN
-				diagnostics.Information(source,position,errorCode,message);
+				diagnostics.Information(source,position,message);
 			END;
 		END Information;
 
@@ -1798,7 +1797,7 @@ VAR
 	BEGIN
 		IF diagnostics # NIL THEN
 			MakeDetailedMessage(pos, code, msg, GetReader(), message);
-			diagnostics.Error(source, pos.start, code, message);
+			diagnostics.Error(source, pos.start, message);
 		END;
 	END ErrorC;
 
@@ -1815,7 +1814,7 @@ VAR
 	BEGIN
 		IF diagnostics # NIL THEN
 			MakeMessage(pos, InvalidCode, msg,message);
-			diagnostics.Warning(source, pos.start, InvalidCode, message);
+			diagnostics.Warning(source, pos.start, message);
 		END;
 	END Warning;
 
@@ -1824,7 +1823,7 @@ VAR
 	BEGIN
 		IF diagnostics # NIL THEN
 			MakeMessage(pos, InvalidCode, msg,message);
-			diagnostics.Information(source, pos.start, InvalidCode, message);
+			diagnostics.Information(source, pos.start, message);
 		END;
 	END Information;
 

+ 2 - 2
source/GenericLinker.Mod

@@ -173,11 +173,11 @@ VAR
 	END SetLinkRoot;
 
 	PROCEDURE Error* (CONST source, message: ARRAY OF CHAR);
-	BEGIN diagnostics.Error (source, Diagnostics.Invalid, Diagnostics.Invalid, message); error := TRUE;
+	BEGIN diagnostics.Error (source, Diagnostics.Invalid, message); error := TRUE;
 	END Error;
 
 	PROCEDURE Warning* (CONST source, message: ARRAY OF CHAR);
-	BEGIN diagnostics.Warning (source, Diagnostics.Invalid, Diagnostics.Invalid, message);
+	BEGIN diagnostics.Warning (source, Diagnostics.Invalid, message);
 	END Warning;
 
 	PROCEDURE ErrorP*(CONST pooledName: ObjectFile.SegmentedName; CONST message: ARRAY OF CHAR);

+ 1 - 1
source/ModuleParser.Mod

@@ -1599,7 +1599,7 @@ BEGIN
 		scanner := FoxScanner.NewScanner(filename, reader, 0, diagnostics);
 		Parse(scanner, module);
 	ELSIF (diagnostics # NIL) THEN
-		diagnostics.Error("ModuleParser", Diagnostics.Invalid, Diagnostics.Invalid, "File not found");
+		diagnostics.Error("ModuleParser", Diagnostics.Invalid, "File not found");
 	END;
 	RETURN module
 END ParseFile;

+ 2 - 7
source/Oberon.PC.Mod

@@ -105,12 +105,7 @@ END Locate;
 PROCEDURE ReportError(entry : Diagnostics.Entry);
 BEGIN
 	PCM.LogW(9X);
-	IF entry.errorCode = -1 THEN
-		PCM.LogWStr("pos "); PCM.LogWNum(entry.position);
-	ELSIF (entry.type # Diagnostics.TypeInformation) THEN
-		PCM.LogWStr("pos  "); PCM.LogWNum(entry.position);
-		PCM.LogWStr("  err  "); PCM.LogWNum(entry.errorCode)
-	END;
+	PCM.LogWStr("pos "); PCM.LogWNum(entry.position);
 	PCM.LogW(9X);
 	PCM.LogWStr(entry.message);
 	PCM.LogWLn;
@@ -301,4 +296,4 @@ END PC.
 	30.03.01	prk	object file version changed to 01X
 	29.03.01	prk	Attributes.StrToTxt inlined
 	25.03.01	prk	renamed, was PCCompiler
-*)
+*)

+ 2 - 2
source/PCAAMD64.Mod

@@ -1930,7 +1930,7 @@ BEGIN
 	TextUtilities.LoadAuto (text, fileName, format, res);
 
 	IF res # 0 THEN
-		diagnostics.Error (fileName, Diagnostics.Invalid, Diagnostics.Invalid, "failed to open file"); RETURN;
+		diagnostics.Error (fileName, Diagnostics.Invalid, "failed to open file"); RETURN;
 	END;
 
 	NEW (assembly, diagnostics, NIL);
@@ -1991,7 +1991,7 @@ BEGIN
 		writer.Update;
 		Files.Register(file);
 	ELSE
-		diagnostics.Error(filename, Diagnostics.Invalid, Diagnostics.Invalid, "Could not create output file");
+		diagnostics.Error(filename, Diagnostics.Invalid, "Could not create output file");
 		error := TRUE;
 	END;
 END WriteBinary;

+ 4 - 4
source/PCM.Mod

@@ -361,11 +361,11 @@ IMPORT
 				err := Diagnostics.Invalid; pos := Diagnostics.Invalid; str := "too many errors"
 			END;
 			IF diagnostics # NIL THEN
-				diagnostics.Error (source, pos, err, str);
+				diagnostics.Error (source, pos, str);
 			END;
 		ELSE
 			IF diagnostics # NIL THEN
-				diagnostics.Information (source, pos, err, str);
+				diagnostics.Information (source, pos, str);
 			END;
 		END;
 	END Error;
@@ -390,7 +390,7 @@ IMPORT
 			GetMessage (err, msg, str);
 		END;
 		IF diagnostics # NIL THEN
-			diagnostics.Warning (source, pos, err, str);
+			diagnostics.Warning (source, pos, str);
 		END;
 	END Warning;
 
@@ -556,4 +556,4 @@ END PCM.
 	25.04.01	prk	array allocation: if length < 0 then trap PCM.ArraySizeTrap
 	30.03.01	prk	object file version changed to 01X
 	29.03.01	prk	Java imports
-*)
+*)

+ 2 - 2
source/PETXMLTree.Mod

@@ -154,7 +154,7 @@ TYPE
 
 		PROCEDURE ReportError(pos, line, row : LONGINT; CONST msg : ARRAY OF CHAR);
 		BEGIN
-			diagnostics.Error("PET", pos, Diagnostics.Invalid, msg);
+			diagnostics.Error("PET", pos, msg);
 			hasErrors := TRUE;
 		END ReportError;
 
@@ -221,4 +221,4 @@ END Cleanup;
 BEGIN
 	Modules.InstallTermHandler(Cleanup);
 	CompilerInterface.Register("XML", "XML Parser", "XML", ParseText);
-END PETXMLTree.
+END PETXMLTree.

+ 26 - 26
source/Release.Mod

@@ -451,7 +451,7 @@ TYPE
 					COPY(build.name, temp);
 					Strings.Append(temp, ": Import # not found in file #");
 					MakeMessage(message, temp, module.imports[i], name);
-					diagnostics.Error(builds.source, pos, Diagnostics.Invalid, message);
+					diagnostics.Error(builds.source, pos, message);
 				END;
 			END;
 		END CheckImports;
@@ -473,7 +473,7 @@ TYPE
 					SplitName(name, pre, mid, suf);
 					IF (module.name # mid)  THEN
 						MakeMessage(message, "Module name not equal to filename in #", name, "");
-						diagnostics.Warning(builds.source, pos, Diagnostics.Invalid, message);
+						diagnostics.Warning(builds.source, pos, message);
 					END;
 					CreateContext(module.name, module.context);
 				END;
@@ -916,7 +916,7 @@ TYPE
 					END;
 				END;
 			ELSE
-				diagnostics.Error("", Diagnostics.Invalid, Diagnostics.Invalid, "No packages");
+				diagnostics.Error("", Diagnostics.Invalid, "No packages");
 			END;
 		END GenerateZipFiles;
 
@@ -1014,7 +1014,7 @@ TYPE
 					END;
 					IF (file.file = NIL) THEN
 						MakeMessage(message, "File # does not exists (Package #)", file.name, file.package.name);
-						diagnostics.Warning(builds.source, file.pos, Diagnostics.Invalid, message);
+						diagnostics.Warning(builds.source, file.pos, message);
 					ELSIF file.IsSourceCode() THEN
 						file.ParseModule(diagnostics);
 					END;
@@ -1299,7 +1299,7 @@ TYPE
 				END;
 			ELSE
 				MakeMessage(message, "File # not found", file.name, "");
-				diagnostics.Error("", file.pos, Diagnostics.Invalid, message);
+				diagnostics.Error("", file.pos, message);
 				error := TRUE;
 			END;
 		END CompileFile;
@@ -1483,7 +1483,7 @@ TYPE
 					INC(nofPrefixes);
 				ELSE
 					error := TRUE;
-					diagnostics.Warning("", Diagnostics.Invalid, Diagnostics.Invalid, "Maximum number of prefixes exceeded");
+					diagnostics.Warning("", Diagnostics.Invalid, "Maximum number of prefixes exceeded");
 					FOR j := 0 TO LEN(prefixes)-1 DO
 						TRACE(prefixes[j]);
 					END;
@@ -1517,9 +1517,9 @@ TYPE
 				IF (file.file = NIL) THEN
 					MakeMessage(message, "File # does not exists (Package #)", file.name, file.package.name);
 					IF file.IsSourceCode() THEN
-						diagnostics.Error(source, file.pos, Diagnostics.Invalid, message);
+						diagnostics.Error(source, file.pos, message);
 					ELSE
-						diagnostics.Warning(source, file.pos, Diagnostics.Invalid, message);
+						diagnostics.Warning(source, file.pos, message);
 					END;
 				ELSIF file.IsSourceCode() THEN
 					file.ParseModule(diagnostics);
@@ -1670,7 +1670,7 @@ TYPE
 				INC(nofBuilds);
 			ELSE
 				error := TRUE;
-				diagnostics.Error(source, Diagnostics.Invalid, Diagnostics.Invalid, "Maximum number of builds exceeded");
+				diagnostics.Error(source, Diagnostics.Invalid, "Maximum number of builds exceeded");
 			END;
 			RETURN ~error;
 		END AddBuild;
@@ -1754,7 +1754,7 @@ TYPE
 								MakeMessage(message, "Excluded package '#' in build '#' does not exist",
 									builds[build].excludedPackages[package]^,
 									builds[build].name);
-								diagnostics.Error(source, Diagnostics.Invalid, Diagnostics.Invalid, message);
+								diagnostics.Error(source, Diagnostics.Invalid, message);
 							END;
 						END;
 					END;
@@ -1816,7 +1816,7 @@ TYPE
 		BEGIN
 			error := TRUE;
 			MakeMessage(message, msg, par1, par2);
-			diagnostics.Error(source, pos, Diagnostics.Invalid, message);
+			diagnostics.Error(source, pos, message);
 		END Error;
 
 		PROCEDURE Check(CONST token : Token) : BOOLEAN;
@@ -1958,14 +1958,14 @@ TYPE
 		BEGIN
 			error := TRUE;
 			MakeMessage(message, msg, par1, par2);
-			diagnostics.Error(scanner.source, pos, Diagnostics.Invalid, message);
+			diagnostics.Error(scanner.source, pos, message);
 		END Error;
 
 		PROCEDURE Warning(pos : LONGINT; CONST msg, par1, par2 : ARRAY OF CHAR);
 		VAR message : ARRAY 128 OF CHAR;
 		BEGIN
 			MakeMessage(message, msg, par1, par2);
-			diagnostics.Warning(scanner.source, pos, Diagnostics.Invalid, message);
+			diagnostics.Warning(scanner.source, pos, message);
 		END Warning;
 
 		PROCEDURE IsFilename(CONST token : Token) : BOOLEAN;
@@ -2313,7 +2313,7 @@ TYPE
 							END;
 							builds.AddFile(token, currentRelease, currentPackage, scanner.pos);
 						ELSE
-							diagnostics.Warning(scanner.source, scanner.pos, Diagnostics.Invalid, "Expected filename (not file extension?)");
+							diagnostics.Warning(scanner.source, scanner.pos, "Expected filename (not file extension?)");
 						END;
 					ELSE
 						Error(scanner.pos, "Expected identifier, found #", token, "");
@@ -2333,7 +2333,7 @@ TYPE
 				Incl(release,index);
 			ELSE
 				MakeMessage(message, "Unknown build prefix #", token, "");
-				diagnostics.Warning(scanner.source, scanner.pos, Diagnostics.Invalid, message);
+				diagnostics.Warning(scanner.source, scanner.pos, message);
 			END;
 			IF scanner.Get(token) THEN
 				IF (token = OPENSECTION) THEN
@@ -2470,13 +2470,13 @@ PROCEDURE GetModuleInfo(
 				IF (context = "") THEN
 					error := TRUE;
 					MakeMessage(message, "Context identifier missing in file #", filename, "");
-					diagnostics.Error(source, errorPosition, Diagnostics.Invalid, message);
+					diagnostics.Error(source, errorPosition, message);
 				END;
 				SkipComments(in);
 			ELSE
 				error := TRUE;
 				MakeMessage(message, "Expected 'IN' keyword in file #", filename, "");
-				diagnostics.Error(source, errorPosition, Diagnostics.Invalid, message);
+				diagnostics.Error(source, errorPosition, message);
 			END;
 		END;
 	END GetContext;
@@ -2500,17 +2500,17 @@ PROCEDURE GetModuleInfo(
 				IF ~error & (ch # ";") THEN
 					error := TRUE;
 					MakeMessage(message, "Expected semicolon after module identifier in file #", filename, "");
-					diagnostics.Error(source, errorPosition, Diagnostics.Invalid, message);
+					diagnostics.Error(source, errorPosition, message);
 				END;
 			ELSE
 				error := TRUE;
 				MakeMessage(message, "Module identifier missing in file #", filename, "");
-				diagnostics.Error(source, errorPosition, Diagnostics.Invalid, message);
+				diagnostics.Error(source, errorPosition, message);
 			END;
 		ELSE
 			error := TRUE;
 			MakeMessage(message, "MODULE keyword missing in file #, first token is #", filename, token);
-			diagnostics.Error(source, errorPosition, Diagnostics.Invalid, message);
+			diagnostics.Error(source, errorPosition, message);
 		END;
 	END GetModuleNameAndContext;
 
@@ -2526,7 +2526,7 @@ PROCEDURE GetModuleInfo(
 		ELSE
 			error := TRUE;
 			MakeMessage(message, "Identifier expected in import section of file #", filename, "");
-			diagnostics.Error(source, errorPosition, Diagnostics.Invalid, message);
+			diagnostics.Error(source, errorPosition, message);
 		END;
 	END GetImport;
 
@@ -2550,7 +2550,7 @@ PROCEDURE GetModuleInfo(
 					ELSE
 						error := TRUE;
 						MakeMessage(message, "Maximum number of supported imports exceeded in module #", filename, "");
-						diagnostics.Error(source, Diagnostics.Invalid, Diagnostics.Invalid, message);
+						diagnostics.Error(source, Diagnostics.Invalid, message);
 						EXIT;
 					END;
 
@@ -2563,7 +2563,7 @@ PROCEDURE GetModuleInfo(
 					ELSE
 						error := TRUE;
 						MakeMessage(message, "Parsing import section of module # failed", filename, "");
-						diagnostics.Error(source, errorPosition, Diagnostics.Invalid, message);
+						diagnostics.Error(source, errorPosition, message);
 						EXIT;
 					END;
 				ELSE
@@ -2679,7 +2679,7 @@ BEGIN
 			reader := fileReader;
 		ELSE
 			MakeMessage(message, "Could not open file #", file.name, "");
-			diagnostics.Error(file.name, file.pos, Diagnostics.Invalid, message);
+			diagnostics.Error(file.name, file.pos, message);
 		END;
 	END;
 	IF (reader = NIL) THEN
@@ -2690,7 +2690,7 @@ BEGIN
 			reader := textReader;
 		ELSE
 			MakeMessage(message, "Could not open file # (Package = )", file.name, "");
-			diagnostics.Error(file.name, file.pos, Diagnostics.Invalid, message);
+			diagnostics.Error(file.name, file.pos, message);
 		END;
 	END;
 	RETURN reader;
@@ -2752,7 +2752,7 @@ BEGIN
 	ELSE
 		builds := NIL;
 		MakeMessage(message, "Could not open file #", filename, "");
-		diagnostics.Error("", Diagnostics.Invalid, Diagnostics.Invalid, message);
+		diagnostics.Error("", Diagnostics.Invalid, message);
 		RETURN FALSE;
 	END;
 END ParseBuildFile;

+ 33 - 33
source/SyntaxHighlighter.Mod

@@ -1435,7 +1435,7 @@ BEGIN
 				Copy(string^, fontname);
 			END;
 		ELSE
-			diagnostics.Warning(source, element.GetPos(), Diagnostics.Invalid, "Style font name missing");
+			diagnostics.Warning(source, element.GetPos(), "Style font name missing");
 		END;
 
 		fontsize := 0;
@@ -1447,7 +1447,7 @@ BEGIN
 				Strings.StrToInt(string^, fontsize);
 			END;
 		ELSE
-			diagnostics.Warning(source, element.GetPos(), Diagnostics.Invalid, "Style attribute font size missing");
+			diagnostics.Warning(source, element.GetPos(), "Style attribute font size missing");
 		END;
 
 		string := element.GetAttributeValue(XmlAttributeFontStyle);
@@ -1468,10 +1468,10 @@ BEGIN
 				IF (res = Strings.Ok) THEN
 					INCL(defined, Color);
 				ELSE
-					diagnostics.Warning(source, element.GetPos(), Diagnostics.Invalid, "Style attribute color: Invalid value");
+					diagnostics.Warning(source, element.GetPos(), "Style attribute color: Invalid value");
 				END;
 			END;
-		ELSE diagnostics.Warning(source, element.GetPos(), Diagnostics.Invalid, "Style attribute color missing");
+		ELSE diagnostics.Warning(source, element.GetPos(), "Style attribute color missing");
 		END;
 
 		bgcolor := 0;
@@ -1483,7 +1483,7 @@ BEGIN
 				IF (res = Strings.Ok) THEN
 					INCL(defined, BgColor);
 				ELSE
-					diagnostics.Warning(source, element.GetPos(), Diagnostics.Invalid, "Style attribute background color: Invalid value");
+					diagnostics.Warning(source, element.GetPos(), "Style attribute background color: Invalid value");
 				END;
 			END;
 		ELSE
@@ -1509,7 +1509,7 @@ BEGIN
 		styles.Add(style);
 	ELSE
 		error := TRUE;
-		diagnostics.Error(source, element.GetPos(), Diagnostics.Invalid, "Style name missing");
+		diagnostics.Error(source, element.GetPos(), "Style name missing");
 	END;
 END ParseStyle;
 
@@ -1530,7 +1530,7 @@ BEGIN
 			IF (string # NIL) & (string^ = XmlStyle) THEN
 				ParseStyle(ptr(XML.Element), styles, source, diagnostics, error);
 			ELSE
-				diagnostics.Warning(source, ptr(XML.Element).GetPos(), Diagnostics.Invalid, "Expected style element");
+				diagnostics.Warning(source, ptr(XML.Element).GetPos(), "Expected style element");
 			END;
 		END;
 	END;
@@ -1571,24 +1571,24 @@ BEGIN
 						END;
 						IF (res # Ok) THEN
 							error := TRUE;
-							diagnostics.Error(source, element.GetPos(), Diagnostics.Invalid, "Token too long");
+							diagnostics.Error(source, element.GetPos(), "Token too long");
 						END;
 						reader.SkipWhitespace;
 						reader.Token(token);
 					END;
 				ELSE
-					diagnostics.Warning(source, element.GetPos(), Diagnostics.Invalid, "Empty group (string)");
+					diagnostics.Warning(source, element.GetPos(), "Empty group (string)");
 				END;
 			ELSE
-				diagnostics.Warning(source, element.GetPos(), Diagnostics.Invalid, "Empty group");
+				diagnostics.Warning(source, element.GetPos(), "Empty group");
 			END;
 		ELSE
 			error := TRUE;
-			diagnostics.Error(source, element.GetPos(), Diagnostics.Invalid, "Could not find style for group...");
+			diagnostics.Error(source, element.GetPos(), "Could not find style for group...");
 		END;
 	ELSE
 		error := TRUE;
-		diagnostics.Error(source, element.GetPos(), Diagnostics.Invalid, "Group name missing");
+		diagnostics.Error(source, element.GetPos(), "Group name missing");
 	END;
 END ParseGroup;
 
@@ -1609,7 +1609,7 @@ BEGIN
 			IF (string # NIL) & (string^ = XmlGroup) THEN
 				ParseGroup(ptr(XML.Element), highlighter, styles, TypeTokens, source, diagnostics, error);
 			ELSE
-				diagnostics.Warning(source, ptr(XML.Element).GetPos(), Diagnostics.Invalid, "Expected group element");
+				diagnostics.Warning(source, ptr(XML.Element).GetPos(), "Expected group element");
 			END;
 		END;
 	END;
@@ -1633,7 +1633,7 @@ BEGIN
 			IF (string # NIL) & (string^ = XmlGroup) THEN
 				ParseGroup(ptr(XML.Element), highlighter, styles, TypeWords, source, diagnostics, error);
 			ELSE
-				diagnostics.Warning(source, ptr(XML.Element).GetPos(), Diagnostics.Invalid, "Expected group element");
+				diagnostics.Warning(source, ptr(XML.Element).GetPos(), "Expected group element");
 			END;
 		END;
 	END;
@@ -1649,7 +1649,7 @@ BEGIN
 	IF (string # NIL) THEN
 		highlighter.numberStyle := styles.Find(string^);
 		IF (highlighter.numberStyle = NIL) THEN
-			diagnostics.Warning(source, ptr(XML.Element).GetPos(), Diagnostics.Invalid, "Number style not found");
+			diagnostics.Warning(source, ptr(XML.Element).GetPos(), "Number style not found");
 		END;
 	END;
 END ParseWords;
@@ -1677,7 +1677,7 @@ BEGIN
 			styleOpen := style;
 		ELSE
 			error := TRUE;
-			diagnostics.Error(source, element.GetPos(), Diagnostics.Invalid, "OpenStyle not found");
+			diagnostics.Error(source, element.GetPos(), "OpenStyle not found");
 		END;
 	END;
 
@@ -1688,7 +1688,7 @@ BEGIN
 			styleClose := style;
 		ELSE
 			error := TRUE;
-			diagnostics.Error(source, element.GetPos(), Diagnostics.Invalid, "CloseStyle not found");
+			diagnostics.Error(source, element.GetPos(), "CloseStyle not found");
 		END;
 	END;
 
@@ -1699,7 +1699,7 @@ BEGIN
 			styleContent := style;
 		ELSE
 			error := TRUE;
-			diagnostics.Error(source, element.GetPos(), Diagnostics.Invalid, "ContentStyle not found");
+			diagnostics.Error(source, element.GetPos(), "ContentStyle not found");
 		END;
 	END;
 
@@ -1708,17 +1708,17 @@ BEGIN
 		Copy(string^, open);
 		IF (open = "") THEN
 			error := TRUE;
-			diagnostics.Error(source, element.GetPos(), Diagnostics.Invalid, "Region attribute open is empty");
+			diagnostics.Error(source, element.GetPos(), "Region attribute open is empty");
 		END;
 	ELSE
 		error := TRUE;
-		diagnostics.Error(source, element.GetPos(), Diagnostics.Invalid, "Region attribute open missing");
+		diagnostics.Error(source, element.GetPos(), "Region attribute open missing");
 	END;
 
 	string := element.GetAttributeValue(XmlAttributeClose);
 	IF (string # NIL) THEN
 		Copy(string^, close);
-	ELSE diagnostics.Warning(source, element.GetPos(), Diagnostics.Invalid, "Region attribute close missing");
+	ELSE diagnostics.Warning(source, element.GetPos(), "Region attribute close missing");
 	END;
 
 	nesting := FALSE;
@@ -1726,7 +1726,7 @@ BEGIN
 	IF (string # NIL) THEN
 		Strings.TrimWS(string^);
 		Strings.StrToBool(string^, nesting);
-	ELSE diagnostics.Warning(source, element.GetPos(), Diagnostics.Invalid, "Region attribute nesting missing");
+	ELSE diagnostics.Warning(source, element.GetPos(), "Region attribute nesting missing");
 	END;
 
 	multiline := FALSE;
@@ -1734,7 +1734,7 @@ BEGIN
 	IF (string # NIL) THEN
 		Strings.TrimWS(string^);
 		Strings.StrToBool(string^, multiline);
-	ELSE diagnostics.Warning(source, element.GetPos(), Diagnostics.Invalid, "Region attribute multiline missing");
+	ELSE diagnostics.Warning(source, element.GetPos(), "Region attribute multiline missing");
 	END;
 
 	IF ~error THEN
@@ -1759,7 +1759,7 @@ BEGIN
 			IF (string # NIL) & (string^ = XmlRegion) THEN
 				ParseRegion(ptr(XML.Element), highlighter, styles, source, diagnostics, error);
 			ELSE
-				diagnostics.Warning(source, ptr(XML.Element).GetPos(), Diagnostics.Invalid, "Expected region element");
+				diagnostics.Warning(source, ptr(XML.Element).GetPos(), "Expected region element");
 			END;
 		END;
 	END;
@@ -1786,7 +1786,7 @@ BEGIN
 				highlighter.defaultStyle := styles.Find(string^);
 				IF (highlighter.defaultStyle = NIL) THEN
 					error := TRUE;
-					diagnostics.Error(source, element.GetPos(), Diagnostics.Invalid, "Default style not found");
+					diagnostics.Error(source, element.GetPos(), "Default style not found");
 				END;
 			END;
 		END;
@@ -1807,7 +1807,7 @@ BEGIN
 		END;
 	ELSE
 		error := TRUE;
-		diagnostics.Error(source, element.GetPos(), Diagnostics.Invalid, "Highlighter name missing");
+		diagnostics.Error(source, element.GetPos(), "Highlighter name missing");
 	END;
 END ParseHighlighter;
 
@@ -1828,7 +1828,7 @@ BEGIN
 			IF (string # NIL) & (string^ = XmlHighlighter) THEN
 				ParseHighlighter(ptr(XML.Element), highlighters, styles, source, diagnostics, error);
 			ELSE
-				diagnostics.Warning(source, ptr(XML.Element).GetPos(), Diagnostics.Invalid, "Expected highlighter element");
+				diagnostics.Warning(source, ptr(XML.Element).GetPos(), "Expected highlighter element");
 			END;
 		END;
 	END;
@@ -1854,7 +1854,7 @@ BEGIN
 			ParseStyles(element, styles, source, diagnostics, error);
 		ELSE
 			error := TRUE;
-			diagnostics.Error(source, element.GetPos(), Diagnostics.Invalid, "Styles section missing");
+			diagnostics.Error(source, element.GetPos(), "Styles section missing");
 		END;
 
 		NEW(highlighters);
@@ -1863,11 +1863,11 @@ BEGIN
 			ParseHighlighters(element, highlighters, styles, source, diagnostics, error);
 		ELSE
 			error := TRUE;
-			diagnostics.Error(source, element.GetPos(), Diagnostics.Invalid, "Highlighters section missing");
+			diagnostics.Error(source, element.GetPos(), "Highlighters section missing");
 		END;
 	ELSE
 		error := TRUE;
-		diagnostics.Error(source, root.GetPos(), Diagnostics.Invalid, "XML root element name mismatch");
+		diagnostics.Error(source, root.GetPos(), "XML root element name mismatch");
 	END;
 END ParseDocument;
 
@@ -1907,7 +1907,7 @@ END FindChild;
 PROCEDURE TrapHandler(pos, line, row: LONGINT; CONST msg: ARRAY OF CHAR);
 BEGIN
 	error := TRUE;
-	diagnostics.Error(source, pos, Diagnostics.Invalid, msg);
+	diagnostics.Error(source, pos, msg);
 END TrapHandler;
 
 PROCEDURE LoadDocument(CONST filename : ARRAY OF CHAR; CONST d: Diagnostics.Diagnostics; VAR e : BOOLEAN) : XML.Document;
@@ -1931,7 +1931,7 @@ BEGIN
 		END;
 	ELSE
 		e := TRUE;
-		d.Error(filename, Diagnostics.Invalid, Diagnostics.Invalid, "File not found");
+		d.Error(filename, Diagnostics.Invalid, "File not found");
 	END;
 	diagnostics := NIL; source := "";
 	ASSERT(error OR (document # NIL));
@@ -2085,4 +2085,4 @@ WMPerfMonPluginModVars.Install SyntaxHighlighter
 	SyntaxHighlighter.NnofPiNestedFull SyntaxHighlighter.NnofPiNestedSimple,
 	SyntaxHighlighter.NnofPiRescan SyntaxHighlighter.NnofPiSimple SyntaxHighlighter.NnofPiNoHit SyntaxHighlighter.NnofPiNoHitRescan
 	SyntaxHighlighter.NnofPiNoHitFull
-~
+~

+ 2 - 2
source/TestSuite.Mod

@@ -59,10 +59,10 @@ TYPE
 		ClearList (tests);
 		WHILE SkipComment (r) DO
 			IF ~ReadType (r, type) OR ~SkipWhitespace (r) OR ~ReadText (r, name) THEN
-				diagnostics.Error (name, r.Pos(), Diagnostics.Invalid, "parse error"); RETURN FALSE;
+				diagnostics.Error (name, r.Pos(), "parse error"); RETURN FALSE;
 			END;
 			IF FindResult (tests, name) # NIL THEN
-				diagnostics.Error (name, Diagnostics.Invalid, Diagnostics.Invalid, "duplicated test"); RETURN FALSE;
+				diagnostics.Error (name, Diagnostics.Invalid, "duplicated test"); RETURN FALSE;
 			END;
 			code.Clear; writer.Reset;
 			WHILE SkipLn (r) & Tabulator (r) & ReadText (r, line) DO writer.Char (09X); writer.String (line); writer.Char (0AX); END;

+ 3 - 3
source/TextConverter.Mod

@@ -13,12 +13,12 @@ BEGIN
 		IF res = 0 THEN
 			converter (text, filename, res);
 			IF res = 0 THEN
-				diagnostics.Information (filename, Diagnostics.Invalid, Diagnostics.Invalid, "successfully converted");
+				diagnostics.Information (filename, Diagnostics.Invalid, "successfully converted");
 			ELSE
-				diagnostics.Information (filename, Diagnostics.Invalid, Diagnostics.Invalid, "failed to store");
+				diagnostics.Information (filename, Diagnostics.Invalid, "failed to store");
 			END
 		ELSE
-			diagnostics.Error (filename, Diagnostics.Invalid, Diagnostics.Invalid, "failed to load");
+			diagnostics.Error (filename, Diagnostics.Invalid, "failed to load");
 		END;
 	END;
 END Convert;

+ 15 - 60
source/WMDiagnostics.Mod

@@ -1,7 +1,7 @@
 MODULE WMDiagnostics; (** AUTHOR "staubesv"; PURPOSE "Visual Component for Diagnostics Interface"; *)
 
 IMPORT
-	Locks, Strings, Diagnostics, Files,
+	Locks, Strings, Diagnostics, Files, Streams,
 	WMRectangles, WMGraphics, WMGraphicUtilities, WMBitmapFont,
 	WMEvents, WMProperties, WMGrids, WMTextView;
 
@@ -32,15 +32,13 @@ CONST
 	SortByTypeDescending* = 1;
 	SortByPositionAscending* = 2;
 	SortByPositionDescending* = 3;
-	SortByErrorCodeAscending* = 4;
-	SortByErrorCodeDescending* = 5;
 
 TYPE
 
 	Entry* = RECORD
 		type- : LONGINT;
 		source- : Files.FileName;
-		position-, errorCode- : LONGINT;
+		position-: Streams.Position;
 		message- : ARRAY 256 OF CHAR;
 	END;
 
@@ -149,40 +147,39 @@ TYPE
 			END;
 		END CheckEntriesSize;
 
-		PROCEDURE Error*(CONST source : ARRAY OF CHAR; position, errorCode : LONGINT; CONST message : ARRAY OF CHAR);
+		PROCEDURE Error*(CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
 		BEGIN
-			Add(TypeError, source, position, errorCode, message, nofErrors)
+			Add(TypeError, source, position, message, nofErrors)
 		END Error;
 
-		PROCEDURE Warning*(CONST source : ARRAY OF CHAR; position, errorCode : LONGINT; CONST message : ARRAY OF CHAR);
+		PROCEDURE Warning*(CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
 		BEGIN
-			Add(TypeWarning, source, position, errorCode, message, nofWarnings);
+			Add(TypeWarning, source, position, message, nofWarnings);
 		END Warning;
 
-		PROCEDURE Information*(CONST source : ARRAY OF CHAR; position, errorCode : LONGINT; CONST message : ARRAY OF CHAR);
+		PROCEDURE Information*(CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR);
 		BEGIN
-			Add(TypeInformation, source, position, errorCode, message, nofInformations);
+			Add(TypeInformation, source, position, message, nofInformations);
 		END Information;
 
-		PROCEDURE Exists(type, position, errorCode : LONGINT; CONST message: ARRAY OF CHAR) : BOOLEAN;
+		PROCEDURE Exists(type: WORD; position : Streams.Position; CONST message: ARRAY OF CHAR) : BOOLEAN;
 		VAR i : LONGINT;
 		BEGIN
 			i := 0;
-			WHILE (i < nofEntries) & ((entries[i].type # type) OR (entries[i].position # position) OR (entries[i].errorCode # errorCode) OR (entries[i].message # message)) DO
+			WHILE (i < nofEntries) & ((entries[i].type # type) OR (entries[i].position # position) OR (entries[i].message # message)) DO
 				INC(i);
 			END;
 			RETURN (nofEntries > 0) & (i < nofEntries);
 		END Exists;
 
-		PROCEDURE Add(type: LONGINT; CONST source : ARRAY OF CHAR; position, errorCode : LONGINT; CONST message : ARRAY OF CHAR; VAR counter: LONGINT);
+		PROCEDURE Add(type: WORD; CONST source : ARRAY OF CHAR; position : Streams.Position; CONST message : ARRAY OF CHAR; VAR counter: LONGINT);
 		BEGIN
 			AcquireWrite;
-			IF ~Exists(type, position, errorCode,message) THEN
+			IF ~Exists(type, position, message) THEN
 				CheckEntriesSize;
 				entries[nofEntries].type := type;
 				COPY(source, entries[nofEntries].source);
 				entries[nofEntries].position := position;
-				entries[nofEntries].errorCode := errorCode;
 				COPY(message, entries[nofEntries].message);
 				INC(nofEntries); INC(counter);
 				changed := TRUE;
@@ -227,7 +224,6 @@ TYPE
 					IF SELF.entries[i].type = type THEN
 						entries[dest].type := SELF.entries[i].type;
 						entries[dest].position := SELF.entries[i].position;
-						entries[dest].errorCode := SELF.entries[i].errorCode;
 						entries[dest].source := SELF.entries[i].source;
 						entries[dest].message := SELF.entries[i].message;
 						INC(dest);
@@ -333,7 +329,7 @@ TYPE
 		END RecacheProperties;
 
 		PROCEDURE OnClickHandler(sender, data : ANY);
-		CONST Position = 0; ErrorCode = 1;
+		CONST Position = 0;
 		VAR column, row, newMode : LONGINT;
 		BEGIN
 			IF ~IsCallFromSequencer() THEN sequencer.ScheduleEvent(SELF.OnClickHandler, sender, data)
@@ -346,38 +342,18 @@ TYPE
 							|SortByTypeAscending:
 								IF (column = Position) THEN
 									newMode := SortByTypeDescending;
-								ELSIF (column = ErrorCode) THEN
-									newMode := SortByErrorCodeAscending;
 								END;
 							|SortByTypeDescending:
 								IF (column = Position) THEN
 									newMode := SortByTypeAscending;
-								ELSIF (column = ErrorCode) THEN
-									newMode := SortByErrorCodeDescending;
 								END;
 							|SortByPositionAscending:
 								IF (column = Position) THEN
 									newMode := SortByPositionDescending;
-								ELSIF (column = ErrorCode) THEN
-									newMode := SortByErrorCodeAscending;
 								END;
 							|SortByPositionDescending:
 								IF (column = Position) THEN
 									newMode := SortByPositionAscending;
-								ELSIF (column = ErrorCode) THEN
-									newMode := SortByErrorCodeDescending;
-								END;
-							|SortByErrorCodeAscending:
-								IF (column = Position) THEN
-									newMode := SortByTypeAscending;
-								ELSIF (column = ErrorCode) THEN
-									newMode := SortByErrorCodeDescending;
-								END;
-							|SortByErrorCodeDescending:
-								IF (column = Position) THEN
-									newMode := SortByTypeDescending;
-								ELSIF (column = ErrorCode) THEN
-									newMode := SortByErrorCodeAscending;
 								END;
 						ELSE
 							newMode := sortByI; (* don't change *)
@@ -412,8 +388,7 @@ TYPE
 		BEGIN
 			ASSERT(
 				(mode = SortByTypeAscending) OR (mode = SortByTypeDescending) OR
-				(mode = SortByPositionAscending) OR (mode = SortByPositionDescending) OR
-				(mode = SortByErrorCodeAscending) OR (mode = SortByErrorCodeDescending)
+				(mode = SortByPositionAscending) OR (mode = SortByPositionDescending)
 			);
 			Acquire;
 			IF (mode # sortByI) THEN
@@ -423,8 +398,6 @@ TYPE
 					|SortByTypeDescending: SortEntries(CompareByType, FALSE);
 					|SortByPositionAscending: SortEntries(CompareByPosition, TRUE);
 					|SortByPositionDescending: SortEntries(CompareByPosition, FALSE);
-					|SortByErrorCodeAscending: SortEntries(CompareByErrorCode, TRUE);
-					|SortByErrorCodeDescending: SortEntries(CompareByErrorCode, FALSE);
 				END;
 				Invalidate;
 			END;
@@ -452,9 +425,7 @@ TYPE
 			IF (textViews # NIL) THEN
 				FOR i := 0 TO nofEntries - 1 DO
 
-					IF (entries[i].errorCode = 400) THEN
-						picture := PicturePCPosition;
-					ELSIF (entries[i].type = Diagnostics.TypeError) THEN
+					IF (entries[i].type = Diagnostics.TypeError) THEN
 						picture := PictureError;
 					ELSIF (entries[i].type = Diagnostics.TypeWarning) THEN
 						picture := PictureWarning;
@@ -649,11 +620,6 @@ TYPE
 						ELSIF entries[y - 1].type = TypeInformation THEN
 							(* do nothing *)
 						END;
-					| 1 : IF (entries[y-1].errorCode # Invalid) THEN
-							Strings.IntToStr(entries[y - 1].errorCode, str);
-						ELSE
-							COPY("", str);
-						END;
 					| 2 : COPY(entries[y - 1].message, str)
 				ELSE
 				END;
@@ -681,17 +647,6 @@ BEGIN
 	RETURN result;
 END CompareByPosition;
 
-PROCEDURE CompareByErrorCode(CONST e1, e2 : Entry) : LONGINT;
-VAR result : LONGINT;
-BEGIN
-	IF (e1.errorCode < e2.errorCode) THEN result := Less;
-	ELSIF (e1.errorCode > e2.errorCode) THEN result := Greater;
-	ELSE
-		result := CompareByPosition(e1, e2);
-	END;
-	RETURN result;
-END CompareByErrorCode;
-
 PROCEDURE CompareByType(CONST e1, e2 : Entry) : LONGINT;
 VAR result : LONGINT;
 BEGIN

+ 1 - 1
source/WhitespaceRemover.Mod

@@ -53,7 +53,7 @@ BEGIN
 	WHILE ~reader.eot DO
 		IF (char = LineFeed) THEN
 			IF lastCharWasWhitespace THEN
-				diagnostics.Warning("", lastWhitespacePosition, Diagnostics.Invalid, "Whitespace at end of line");
+				diagnostics.Warning("", lastWhitespacePosition, "Whitespace at end of line");
 				lastCharWasWhitespace := FALSE;
 			END;
 		ELSIF TextUtilities.IsWhiteSpace(char, text.isUTF) THEN

+ 1 - 1
tools/builds/a2/DependencyWalker.Mod

@@ -7,7 +7,7 @@ VAR reader: Streams.Reader; scanner: FoxScanner.Scanner; parser: FoxParser.Parse
 VAR module: FoxSyntaxTree.Module; import: FoxSyntaxTree.Import; string: ARRAY 64 OF CHAR;
 BEGIN
 	reader := FoxBasic.GetFileReader (moduleName);
-	IF reader = NIL THEN diagnostics.Error (moduleName, Diagnostics.Invalid, Diagnostics.Invalid, "Failed to open module"); RETURN FALSE END;
+	IF reader = NIL THEN diagnostics.Error (moduleName, Diagnostics.Invalid, "Failed to open module"); RETURN FALSE END;
 	scanner := FoxScanner.NewScanner (moduleName, reader, 0, diagnostics);
 	NEW (parser, scanner, diagnostics);
 	module := parser.Module ();