public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/modula-2] Bugfix assign currentScope during M2Error FlushAll.
@ 2021-12-25 21:11 Gaius Mulley
  0 siblings, 0 replies; only message in thread
From: Gaius Mulley @ 2021-12-25 21:11 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7f1006fd39ea35b048e542aada6c045319407d69

commit 7f1006fd39ea35b048e542aada6c045319407d69
Author: Gaius Mulley <gaius.mulley@southwales.ac.uk>
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 <gaius.mulley@southwales.ac.uk>

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 ;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-25 21:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-25 21:11 [gcc/devel/modula-2] Bugfix assign currentScope during M2Error FlushAll Gaius Mulley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).