changed mechanism for for-loop checking, added some trap numbers
authorceriel <none@none>
Mon, 9 Nov 1987 11:36:45 +0000 (11:36 +0000)
committerceriel <none@none>
Mon, 9 Nov 1987 11:36:45 +0000 (11:36 +0000)
lang/m2/libm2/LIST
lang/m2/libm2/Makefile
lang/m2/libm2/Traps.def
lang/m2/libm2/catch.c

index bb10d60..f70b0be 100644 (file)
@@ -16,7 +16,6 @@ Semaphores.mod
 random.mod
 Strings.mod
 catch.c
-FORchk.c
 Traps.mod
 Arguments.c
 LtoUset.e
index 1276d8a..af175bc 100644 (file)
@@ -11,4 +11,4 @@ all:
 
 install:
                -mkdir $(DEFDIR)
-               for i in $(SOURCES) ; do cp $$i $(DEFDIR)/$$i ; done
+               cp $(SOURCES) $(DEFDIR)
index 6854bb1..46d34aa 100644 (file)
@@ -7,6 +7,9 @@ DEFINITION MODULE Traps;
        ERRTOOMANY =    65;     (* too many nested traps + handlers *)
        ERRNORESULT =   66;     (* no RETURN from function procedure *)
        ERRCARDOVFL =   67;     (* CARDINAL overflow *)
+       ERRFORLOOP =    68;     (* value of FOR-loop control variable changed
+                                  in loop
+                               *)
 
   TYPE TrapHandler = EM.TrapHandler;
 
index 57e6ee0..2e6a4ae 100644 (file)
@@ -34,6 +34,7 @@ static struct errm {
        { M2_TOOMANY,   "too many nested traps + handlers"},
        { M2_NORESULT,  "no RETURN from procedure function"},
        { M2_UOVFL,     "cardinal overflow"},
+       { M2_FORCH,     "Warning: FOR-loop control variable was changed in the body"},
        { -1,           0}
 };
 
@@ -70,5 +71,6 @@ _catch(trapno)
                *p = 0;
                Traps_Message(q, 0, (int) (p - q), 1);
        }
-       exit(trapno);
+       if (trapno != M2_FORCH) exit(trapno);
+       SIG(_catch);
 }