[gcc r16-6338] a68: fix handling of underscores in PARSE_INDICANT

Jose E. Marchesi jemarch@gcc.gnu.org
Mon Dec 22 19:42:32 GMT 2025


https://gcc.gnu.org/g:3b066c183949bfde30ec2221d6bb4bd32ebd01c4

commit r16-6338-g3b066c183949bfde30ec2221d6bb4bd32ebd01c4
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date:   Mon Dec 22 20:39:37 2025 +0100

    a68: fix handling of underscores in PARSE_INDICANT
    
    Signed-off-by: Jose E. Marchesi <jemarch@gnu.org>
    
    gcc/algol68/ChangeLog
    
            * a68-imports.cc (PARSE_INDICANT): Fix handling of uderscore
            characters.
    
    gcc/testsuite/ChangeLog
    
            * algol68/execute/modules/Modules20.map (module-bar): Add
            underscores.

Diff:
---
 gcc/algol68/a68-imports.cc                          | 4 +++-
 gcc/testsuite/algol68/execute/modules/Modules20.map | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gcc/algol68/a68-imports.cc b/gcc/algol68/a68-imports.cc
index 2fbe15d4156f..d8c1f1f7ba92 100644
--- a/gcc/algol68/a68-imports.cc
+++ b/gcc/algol68/a68-imports.cc
@@ -69,7 +69,9 @@
 	  (W)[i++] = *((P)++);						\
 	  while (ISALPHA (*(P)) || ISDIGIT(*(P)) || (*(P)) == '_')	\
 	    {								\
-	      if ((*(P)) != '_')					\
+	      if ((*(P)) == '_')					\
+		(P)++;							\
+	      else							\
 		(W)[i++] = *((P)++);					\
 	    }								\
 	}								\
diff --git a/gcc/testsuite/algol68/execute/modules/Modules20.map b/gcc/testsuite/algol68/execute/modules/Modules20.map
index 4bcb669570eb..9dbfa071942b 100644
--- a/gcc/testsuite/algol68/execute/modules/Modules20.map
+++ b/gcc/testsuite/algol68/execute/modules/Modules20.map
@@ -1,2 +1,2 @@
-module-foo=Foo:
-module-bar=Bar
+module-foo=F_oo:
+module-bar=Bar_


More information about the Gcc-cvs mailing list