Переглянути джерело

Simplified fingerprint initialisation

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8554 8c9fc860-2736-0410-a75d-ab315db34111
negelef 6 роки тому
батько
коміт
7805e5abb0
2 змінених файлів з 3 додано та 17 видалено
  1. 0 1
      source/FoxSemanticChecker.Mod
  2. 3 16
      source/FoxSyntaxTree.Mod

+ 0 - 1
source/FoxSemanticChecker.Mod

@@ -6244,7 +6244,6 @@ TYPE
 				ELSIF HasFlag(modifiers,Global.NameAbstract,position) THEN procedure.SetAbstract(TRUE)
 				END;
 				IF HasValue(modifiers, Global.NameFingerprint, position, value) THEN 
-					SyntaxTree.InitFingerprint(fp);
 					fp.shallow := LONGINT(value); (* TODO: fix explicit integer truncation *)
 					fp.public := LONGINT(value); (* TODO: fix explicit integer truncation *)
 					fp.private := LONGINT(value); (* TODO: fix explicit integer truncation *)

+ 3 - 16
source/FoxSyntaxTree.Mod

@@ -476,8 +476,8 @@ TYPE
 	END;
 
 	Fingerprint*= RECORD
-		shallow*,public*, private*: Basic.Fingerprint;
-		shallowAvailable*, deepAvailable*: BOOLEAN;
+		shallow* := 0, public* := 0, private* := 0: Basic.Fingerprint;
+		shallowAvailable* := FALSE, deepAvailable* := FALSE: BOOLEAN;
 	END;
 
 	(** identifiers in a program text **)
@@ -565,11 +565,8 @@ TYPE
 			isRealtime := FALSE;
 			recursion := FALSE;
 			hasPointers := FALSE;
-			InitFingerprint(fingerprint);
 		END InitType;
 
-		
-
 		PROCEDURE SetSize*(sizeInBits: LONGINT);
 		BEGIN SELF.sizeInBits := sizeInBits
 		END SetSize;
@@ -2598,7 +2595,7 @@ TYPE
 	VAR fingerprint-: Fingerprint;
 
 		PROCEDURE &InitValue(position: Position);
-		BEGIN SELF.position := position; resolved := SELF; InitFingerprint(fingerprint);
+		BEGIN SELF.position := position; resolved := SELF;
 		END InitValue;
 
 		PROCEDURE SetFingerprint*(CONST fp: Fingerprint);
@@ -2932,7 +2929,6 @@ TYPE
 			alignment := 0; (* take default *)
 			fixed := FALSE;
 			used := FALSE; written := FALSE;
-			InitFingerprint(fingerprint);
 			comment := NIL;
 		END InitSymbol;
 
@@ -5143,15 +5139,6 @@ VAR
 
 	indexListSeparator-: Expression;
 
-	PROCEDURE InitFingerprint*(VAR fingerprint: Fingerprint);
-	BEGIN
-		fingerprint.shallowAvailable := FALSE;
-		fingerprint.deepAvailable := FALSE;
-		fingerprint.shallow := 0;
-		fingerprint.private := 0;
-		fingerprint.public := 0;
-	END InitFingerprint;
-
 	PROCEDURE NewModule*( CONST sourceName: ARRAY OF CHAR; position: Position;  name: Identifier;scope: ModuleScope; case: LONGINT ): Module;
 	VAR module: Module;
 	BEGIN