From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1499) id 6157A3858C39; Sat, 25 Dec 2021 21:11:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6157A3858C39 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Gaius Mulley To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/modula-2] Bugfix assign currentScope during M2Error FlushAll. X-Act-Checkin: gcc X-Git-Author: Gaius Mulley X-Git-Refname: refs/heads/devel/modula-2 X-Git-Oldrev: 7f91bb254c4214f89006ea9bf3d64cf3dc965594 X-Git-Newrev: 7f1006fd39ea35b048e542aada6c045319407d69 Message-Id: <20211225211137.6157A3858C39@sourceware.org> Date: Sat, 25 Dec 2021 21:11:37 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Dec 2021 21:11:37 -0000 https://gcc.gnu.org/g:7f1006fd39ea35b048e542aada6c045319407d69 commit 7f1006fd39ea35b048e542aada6c045319407d69 Author: Gaius Mulley Date: Sat Dec 25 21:10:48 2021 +0000 Bugfix assign currentScope during M2Error FlushAll. gcc/m2/ChangeLog: * gm2-compiler/M2Error.mod (EnterProcedureScope): Corrected indentation. (EnterModuleScope): Corrected indentation. (EnterProgramScope): Corrected indentation. (EnterImplementationScope) Corrected indentation. (FlushAll) Assign currentScope to the error scope. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/M2Error.mod | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/gcc/m2/gm2-compiler/M2Error.mod b/gcc/m2/gm2-compiler/M2Error.mod index 379fd67ef4e..b15843e376f 100644 --- a/gcc/m2/gm2-compiler/M2Error.mod +++ b/gcc/m2/gm2-compiler/M2Error.mod @@ -68,10 +68,10 @@ TYPE KindScope = (noscope, definition, implementation, program, module, procedure) ; ErrorScope = POINTER TO RECORD - scopeKind: KindScope ; - scopeName: Name ; + scopeKind: KindScope ; + scopeName: Name ; symbol : CARDINAL ; (* symbol table entry. *) - END ; + END ; VAR @@ -642,6 +642,7 @@ BEGIN WITH e^ DO IF (FatalStatus=fatal) AND (s#NIL) THEN + currentScope := scope ; CheckIncludes (token, 0) ; EmitError (fatal, note, token, AnnounceScope (e, s)) ; IF (child#NIL) AND FlushAll (child, FatalStatus) @@ -656,13 +657,13 @@ BEGIN IF NOT Debugging THEN WITH f^ DO - s := KillString(s) + s := KillString (s) END ; - DISPOSE(f) + DISPOSE (f) END ; UNTIL e=NIL END ; - RETURN( written ) + RETURN written END FlushAll ; @@ -678,7 +679,7 @@ BEGIN printf0('\nFlushing all errors\n') ; printf0('===================\n') END ; - IF FlushAll(head, TRUE) + IF FlushAll (head, TRUE) THEN ExitOnHalt(1) ; HALT @@ -952,13 +953,13 @@ BEGIN INC (scopeIndex) ; es := GetIndice (scopeArray, scopeIndex) ; IF DebugError - THEN + THEN IF IsPass1 () THEN printf3 ("pass 1: %d %d %d\n", scopeIndex, es^.scopeKind, kind) ELSE printf3 ("pass 2: %d %d %d\n", scopeIndex, es^.scopeKind, kind) - END + END END ; Assert (es^.scopeKind = kind) END ; @@ -1037,9 +1038,9 @@ BEGIN IF currentScope^.scopeName = NulName THEN IF DebugError - THEN + THEN printf1 ("seen implementation: %a\n", scopename) - END ; + END ; currentScope^.scopeName := scopename END END EnterImplementationScope ; @@ -1057,9 +1058,9 @@ BEGIN IF currentScope^.scopeName = NulName THEN IF DebugError - THEN + THEN printf1 ("seen program: %a\n", scopename) - END ; + END ; currentScope^.scopeName := scopename END END EnterProgramScope ; @@ -1079,7 +1080,7 @@ BEGIN IF DebugError THEN printf1 ("seen module: %a\n", scopename) - END ; + END ; currentScope^.scopeName := scopename END END EnterModuleScope ; @@ -1097,9 +1098,9 @@ BEGIN IF currentScope^.scopeName = NulName THEN IF DebugError - THEN + THEN printf1 ("seen definition: %a\n", scopename) - END ; + END ; currentScope^.scopeName := scopename END END EnterDefinitionScope ; @@ -1117,9 +1118,9 @@ BEGIN IF currentScope^.scopeName = NulName THEN IF DebugError - THEN + THEN printf1 ("seen procedure: %a\n", scopename) - END ; + END ; currentScope^.scopeName := scopename END END EnterProcedureScope ;