[COMMITTED] a68: fix handling of underscores in PARSE_INDICANT

Jose E. Marchesi jose.marchesi@oracle.com
Mon Dec 22 19:42:56 GMT 2025


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.
---
 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 2fbe15d4156..d8c1f1f7ba9 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 4bcb669570e..9dbfa071942 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_
-- 
2.30.2



More information about the Algol68 mailing list