Quellcode durchsuchen

feat(express): verify proc35 exact; FoldConstOp IF/ELSIF/ELSE + inner-AND

Eric Streit vor 2 Wochen
Ursprung
Commit
3a33ea72fa
1 geänderte Dateien mit 9 neuen und 11 gelöschten Zeilen
  1. 9 11
      src/compiler/EXPRESS.MOD

+ 9 - 11
src/compiler/EXPRESS.MOD

@@ -283,23 +283,21 @@ BEGIN
   (*{046a}*) (* resTyp side CARDINAL constant *)
   IF (resTyp^.typ = Compiler.CardType)
      AND ((RecordPtr(curDesc^.typ) = Compiler.AddressType)
-          OR ((RecordPtr(curDesc^.typ) = Compiler.IntType) AND (resTyp^.mode = 0))
-          OR (INTEGER(resTyp^.value) >= 0)) THEN
+          OR ((RecordPtr(curDesc^.typ) = Compiler.IntType)
+              AND (resTyp^.mode = 0)
+              AND (INTEGER(resTyp^.value) >= 0))) THEN
     resTyp^.typ := curDesc^.typ;
-    RETURN;
-  END;
-  (*{0492}*) (* mirrored: curDesc side CARDINAL constant *)
-  IF (RecordPtr(curDesc^.typ) = Compiler.CardType)
+  ELSIF (RecordPtr(curDesc^.typ) = Compiler.CardType)
      AND ((resTyp^.typ = Compiler.AddressType)
-          OR ((resTyp^.typ = Compiler.IntType) AND (curDesc^.mode = 0))
-          OR (INTEGER(curDesc^.value) >= 0)) THEN
+          OR ((resTyp^.typ = Compiler.IntType)
+              AND (curDesc^.mode = 0)
+              AND (INTEGER(curDesc^.value) >= 0))) THEN
     curDesc^.typ := NodePtr(resTyp^.typ);
-    RETURN;
-  END;
-  (*{04b8}*) (* incompatible operand types *)
+  ELSE (*{04b8}*) (* incompatible operand types *)
   IF NOT IsSet(resTyp^.typ, RecordPtr(curDesc^.typ)) THEN
     Errors.ReportIncompatibleTypes(SymTab.T1(resTyp^.typ), SymTab.T1(curDesc^.typ), "");
   END;
+  END;
 END FoldConstOp;
 
 (* proc7 @04cd (REV @0275) — ~ConstToCard: big-OR IF-THEN. c is a TYPE