diff --git a/doc/LexillaHistory.html b/doc/LexillaHistory.html
index 49a3fce88..5114c7f72 100644
--- a/doc/LexillaHistory.html
+++ b/doc/LexillaHistory.html
@@ -600,6 +600,10 @@
Released 18 December 2024.
+ Modula-3: Allow digits in uppercase identifiers.
+ Issue #297.
+
+
Pascal: Fix asm style extending past end.
Issue #295.
diff --git a/lexers/LexModula.cxx b/lexers/LexModula.cxx
index caec8eb3d..10aa6adb2 100644
--- a/lexers/LexModula.cxx
+++ b/lexers/LexModula.cxx
@@ -366,7 +366,7 @@ static void ColouriseModulaDoc( Sci_PositionU startPos,
if( isupper( sc.ch ) && isupper( sc.chNext ) ) {
for( i = 0; i < BUFLEN - 1; i++ ) {
buf[i] = sc.GetRelative(i);
- if( !isalpha( buf[i] ) && !(buf[i] == '_') )
+ if( !(IsAlphaNumeric( buf[i] ) || buf[i] == '_') )
break;
}
kl = i;
diff --git a/test/examples/modula/Issue297.m3 b/test/examples/modula/Issue297.m3
new file mode 100644
index 000000000..9c0c802d6
--- /dev/null
+++ b/test/examples/modula/Issue297.m3
@@ -0,0 +1,6 @@
+INTERFACE Issue297;
+
+TYPE
+ INTEGER32 = [-16_7fffffff-1 .. 16_7fffffff];
+
+END Issue297.
diff --git a/test/examples/modula/Issue297.m3.folded b/test/examples/modula/Issue297.m3.folded
new file mode 100644
index 000000000..80b55701c
--- /dev/null
+++ b/test/examples/modula/Issue297.m3.folded
@@ -0,0 +1,7 @@
+ 0 400 400 INTERFACE Issue297;
+ 1 400 400
+ 0 400 400 TYPE
+ 0 400 400 INTEGER32 = [-16_7fffffff-1 .. 16_7fffffff];
+ 1 400 400
+ 0 400 3ff END Issue297.
+ 1 3ff 3ff
\ No newline at end of file
diff --git a/test/examples/modula/Issue297.m3.styled b/test/examples/modula/Issue297.m3.styled
new file mode 100644
index 000000000..0461cea48
--- /dev/null
+++ b/test/examples/modula/Issue297.m3.styled
@@ -0,0 +1,6 @@
+{4}INTERFACE{0} Issue297{16};{0}
+
+{4}TYPE{0}
+ INTEGER32 {16}={0} {16}[-{7}16_7fffffff{16}-{6}1{0} {16}..{0} {7}16_7fffffff{16}];{0}
+
+{4}END{0} Issue297{16}.{0}