Skip to content

Commit

Permalink
#297 Allow uppercase Modula identifiers to contain digits.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdipardo authored and nyamatongwe committed Dec 21, 2024
1 parent d0ef4d2 commit 7b0a1d7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions doc/LexillaHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,10 @@ <h3>
Released 18 December 2024.
</li>
<li>
Modula-3: Allow digits in uppercase identifiers.
<a href="https://github.com/ScintillaOrg/lexilla/issues/297">Issue #297</a>.
</li>
<li>
Pascal: Fix asm style extending past end.
<a href="https://github.com/ScintillaOrg/lexilla/issues/295">Issue #295</a>.
</li>
Expand Down
2 changes: 1 addition & 1 deletion lexers/LexModula.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions test/examples/modula/Issue297.m3
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
INTERFACE Issue297;

TYPE
INTEGER32 = [-16_7fffffff-1 .. 16_7fffffff];

END Issue297.
7 changes: 7 additions & 0 deletions test/examples/modula/Issue297.m3.folded
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions test/examples/modula/Issue297.m3.styled
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit 7b0a1d7

Please sign in to comment.