io-core / Attest

a tool to digitally sign source code as a comment at the bottom of the file
MIT License
0 stars 0 forks source link

Mod files do not even compile #1

Open schierlm opened 5 years ago

schierlm commented 5 years ago

The Mod files in this repo do not even compile. A diff for the things to make it compile (I did not dare to test it afterwards):

--- 1/KeySafeFrames.Mod
+++ 2/KeySafeFrames.Mod
@@ -75,8 +75,8 @@
   PROCEDURE SetChangeMark(f: Frame; col: INTEGER); (*set mark in corner of frame*)
   BEGIN
     IF f.H > 16 THEN
-      IF col = 0 THEN Display.ReplConst(Display.black, f.X+F.W-12, f.Y+F.H-12, 8, 8, Display.replace)
-      ELSE Display.CopyPattern(Display.white, Display.block, f.X+f.W-12, f.Y+F.H-12, Display.paint)
+      IF col = 0 THEN Display.ReplConst(Display.black, f.X+f.W-12, f.Y+f.H-12, 8, 8, Display.replace)
+      ELSE Display.CopyPattern(Display.white, Display.block, f.X+f.W-12, f.Y+f.H-12, Display.paint)
       END
     END
   END SetChangeMark;
@@ -156,7 +156,7 @@

   PROCEDURE Change*(f: Frame; VAR msg: KeySafes.Msg);
   BEGIN
-    IF F # NIL THEN Erase(f); KeySafes.Change(f.keysafe, msg); Draw(f) END
+    IF f # NIL THEN Erase(f); KeySafes.Change(f.keysafe, msg); Draw(f) END
   END Change;

   PROCEDURE FlipMark(x, y: INTEGER);
@@ -190,12 +190,12 @@
       beg, end, time: LONGINT;
       k1, k2: SET;
       mark, newmark: Location;
-      t: Texts.Text;
+      T: Texts.Text;
       Fd: Frame;
       S: KeySafes.KeySafe;  
-  BEGIN  k1 := k0; S := F.keysafe;
+  BEGIN  k1 := k0; S := f.keysafe;
     REPEAT Input.Mouse(k2, x1, y1); k1 := k1 + k2;
-      DEC(x1, (x1-F.x) MOD 4); DEC(y1, (y1-F.y) MOD 4);
+      DEC(x1, (x1-f.x) MOD 4); DEC(y1, (y1-f.y) MOD 4);
       Oberon.DrawMouse(Crosshair, x1, y1)
     UNTIL  k2 = {};
     Oberon.FadeMouse;
@@ -205,7 +205,7 @@
         IF (w < 7) & (h < 7) THEN (*set mark*)
           IF (x1 - markW >= f.X) & (x1 + markW < f.X1) &
             (y1 - markW >= f.Y) & (y1 + markW < f.Y1) THEN
-            Defocus(F); Oberon.PassFocus(Viewers.This(f.X, F.Y));
+            Defocus(f); Oberon.PassFocus(Viewers.This(f.X, f.Y));
             f.mark.x := x1; f.mark.y := y1; f.marked := TRUE; FlipMark(x1, y1)
           END
         ELSE (*draw line*) Deselect(f);
--- 1/Attest.Mod
+++ 2/Attest.Mod
@@ -38,7 +38,7 @@
   BEGIN
     IF Oberon.Par.frame = Oberon.Par.vwr.dsc THEN
       F := Oberon.Par.vwr.dsc.next(KeySafeFrames.Frame);
-      KeySafeFrames.Erase(F); KeySafes.Delete(F.image)
+      KeySafeFrames.Erase(F); KeySafes.Delete(F.keysafe)
     END
   END Delete;

So mostly wrongly cased variables.

Seems that the same or similar compile errors are also in PackageFrames/Mod of Mod package and in VaultFrames/Crypto of Crypto package.

charlesap commented 5 years ago

Yes, here I am sketching out some possible extensions to the Oberon system by merely copying, renaming, and stubbing-out broad sections of the Rectangles.Mod & Curves.Mod > Graphics.Mod > GraphicFrames.Mod > Draw.Mod example of an Oberon 'application' (e.g. Primitives, Structures, Interfaces, Commands.) I hope to return to these packages after doing some more preparatory work in the base system, as I want to have an Oberon with secure provenance at the core.

schierlm commented 5 years ago

OK, fair point.

On the other hand, some other "applications" (like the compiler or the "file manager") work without additional UI modules, and I believe the same can be true for a package manager or a cryptographic key manager. (Just have an Attest.Tool with command inside and try to interact with extra text viewers like System.Directory does, or with the log viewer).

But I will just wait what you will build, and judge it when it is ready :D