Browse Source

Reenabled body header containing modifiers (such as ACTIVE or EXCLUSIVE) for symbol files

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7016 8c9fc860-2736-0410-a75d-ab315db34111
skoster 8 years ago
parent
commit
a9e534c327
1 changed files with 23 additions and 20 deletions
  1. 23 20
      source/FoxPrintout.Mod

+ 23 - 20
source/FoxPrintout.Mod

@@ -318,8 +318,8 @@ TYPE
 			IF x.firstParameter # NIL THEN ParameterList(x.firstParameter) END;
 			Scope(x.cellScope);
 
-			IF (x.cellScope IS SyntaxTree.CellScope) & (x.cellScope(SyntaxTree.CellScope).bodyProcedure # NIL) & (mode >= SourceCode) THEN
-				Body(x.cellScope(SyntaxTree.CellScope).bodyProcedure.procedureScope.body)
+			IF (x.cellScope IS SyntaxTree.CellScope) & (x.cellScope(SyntaxTree.CellScope).bodyProcedure # NIL) THEN
+				Body(x.cellScope(SyntaxTree.CellScope).bodyProcedure.procedureScope.body, mode >= SourceCode)
 			END;
 
 			Indent; Keyword("END ");
@@ -355,8 +355,8 @@ TYPE
 				END;
 				Scope(x.recordScope);
 
-				IF (x.recordScope.bodyProcedure # NIL)  & (mode >= SourceCode) THEN
-					Body(x.recordScope.bodyProcedure.procedureScope.body)
+				IF (x.recordScope.bodyProcedure # NIL) THEN
+					Body(x.recordScope.bodyProcedure.procedureScope.body, mode >= SourceCode)
 				END;
 
 				Indent; Keyword("END ");
@@ -1476,8 +1476,8 @@ TYPE
 			currentScope := x;
 			IF (mode  >= SourceCode) OR (x.ownerProcedure.isInline) OR (x.ownerProcedure.isOberonInline) THEN 
 				Scope(x); 
-				IF x.body # NIL THEN Body(x.body) END;
 			END;
+			IF (mode >= SymbolFile) & (x.body # NIL) THEN Body(x.body,  (mode  >= SourceCode) OR (x.ownerProcedure.isInline) OR (x.ownerProcedure.isOberonInline) ) END;
 			currentScope := prevScope;
 		END ProcedureScope;
 
@@ -1810,25 +1810,28 @@ TYPE
 			Indent; Keyword("END");
 		END VisitCode;
 
-		PROCEDURE Body(x: SyntaxTree.Body);
+		PROCEDURE Body(x: SyntaxTree.Body; implementation: BOOLEAN);
 		VAR
 		BEGIN
 			IF x.code # NIL THEN
 				Indent; Keyword("CODE");
-				Code(x.code);
+				IF implementation THEN
+					Code(x.code);
+				END;
 			ELSE
-				Keyword("(* BODY *)");
 				Indent;  Keyword("BEGIN" ); Modifiers(x.blockModifiers);
-				IF x.statements # NIL THEN
-					w.IncIndent;
-					StatementSequence(x.statements);
-					w.DecIndent;
-				END;
-				IF x.finally # NIL THEN
-					Indent;  Keyword("FINALLY" );
-					w.IncIndent;
-					StatementSequence(x.finally);
-					w.DecIndent
+				IF implementation THEN
+					IF x.statements # NIL THEN
+						w.IncIndent;
+						StatementSequence(x.statements);
+						w.DecIndent;
+					END;
+					IF x.finally # NIL THEN
+						Indent;  Keyword("FINALLY" );
+						w.IncIndent;
+						StatementSequence(x.finally);
+						w.DecIndent
+					END;
 				END;
 			END;
 			(* "END" written by caller *)
@@ -1865,8 +1868,8 @@ TYPE
 					BuiltinList(x.moduleScope.firstBuiltin)
 				END;
 
-				IF (x.moduleScope.bodyProcedure # NIL) & (x.moduleScope.bodyProcedure.procedureScope.body # NIL) & (mode >= SourceCode) THEN
-					Body(x.moduleScope.bodyProcedure.procedureScope.body)
+				IF (x.moduleScope.bodyProcedure # NIL) & (x.moduleScope.bodyProcedure.procedureScope.body # NIL) THEN
+					Body(x.moduleScope.bodyProcedure.procedureScope.body, mode >= SourceCode)
 				END;
 				Indent; Keyword("END "); Identifier(x.name); w.String( "." ); w.Ln;  w.Update;