DEADSOFTWARE

cpmake: fix preprocessor selector handling
[cpc.git] / src / generic / Dev / Mod / CPM.cp
index 38cfe53fb66928cd5a963fefe207c8c10bcf7e90..4cbeb5034a515d9fd03c2c49645099b87889eea4 100644 (file)
@@ -503,7 +503,7 @@ MODULE DevCPM;
                        END;
                        IF trap IN options THEN HALT(100) END;
                ELSIF (n <= -700) & (errors < maxErrors) THEN
-                       errNo[errors] := -n; errPos[errors] := pos; INC(errors)
+                       errNo[errors] := n; errPos[errors] := pos; INC(errors)
                END
        END Mark;
        
@@ -514,7 +514,7 @@ MODULE DevCPM;
        
        PROCEDURE GetErrorMsg (err: INTEGER; OUT msg: ARRAY OF CHAR);
        BEGIN
-               CASE err OF
+               CASE ABS(err) OF
                | 0: msg := 'undeclared identifier'
                | 1: msg := 'multiply defined identifier'
                | 2: msg := 'illegal character in number'
@@ -734,6 +734,24 @@ MODULE DevCPM;
                | 301: msg := 'implicit type cast'
                | 302: msg := 'guarded variable can be side-effected'
                | 303: msg := 'open array (or pointer to array) containing pointers'
+               | 401: msg := 'bytecode restriction: no structured assignment'
+               | 402: msg := 'bytecode restriction: no procedure types'
+               | 403: msg := 'bytecode restriction: no nested procedures'
+               | 404: msg := 'bytecode restriction: illegal SYSTEM function'
+               | 410: msg := 'variable may not have been assigned'
+               | 411: msg := 'no proofable return'
+               | 412: msg := 'illegal constructor call'
+               | 413: msg := 'missing constructor call'
+               | 501: msg := 'user defined error'
+(* COM-related
+                | 700: msg := '700'
+                | 701: msg := '701'
+                | 702: msg := '702'
+                | 703: msg := '703'
+*)
+                | 777: msg := 'register not released'
+                | 778: msg := 'float register not released'
+                | 779: msg := 'float register overallocated'
                | 900: msg := 'never used'
                | 901: msg := 'never set'
                | 902: msg := 'used before set'
@@ -749,14 +767,6 @@ MODULE DevCPM;
                | 912: msg := 'superfluous type guard'
                | 913: msg := 'call might depend on evaluation sequence of params.'
                | 930: msg := 'superfluous semicolon'
-               | 401: msg := 'bytecode restriction: no structured assignment'
-               | 402: msg := 'bytecode restriction: no procedure types'
-               | 403: msg := 'bytecode restriction: no nested procedures'
-               | 404: msg := 'bytecode restriction: illegal SYSTEM function'
-               | 410: msg := 'variable may not have been assigned'
-               | 411: msg := 'no proofable return'
-               | 412: msg := 'illegal constructor call'
-               | 413: msg := 'missing constructor call'
                ELSE Strings.IntToString(err, msg)
                END
        END GetErrorMsg;
@@ -791,6 +801,9 @@ MODULE DevCPM;
                                Console.WriteChar(":");
                                Strings.IntToString(errPos[n], s); Console.WriteStr(s);
                                Console.WriteStr(": ");
+                               IF errNo[n] >= 0 THEN Console.WriteStr("error: ")
+                               ELSE Console.WriteStr("warning: ")
+                               END;
                                GetErrorMsg(errNo[n], s);
                                Console.WriteStr(s);
                                Console.WriteLn;