Additional rules for BeautifyClassName().

This commit is contained in:
Marisa the Magician 2024-01-22 18:35:54 +01:00
parent d46641593d
commit 891b69d3da
2 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1095 \cu(Thu 18 Jan 13:17:52 CET 2024)\c-";
SWWM_SHORTVER="\cw1.3pre r1095 \cu(2024-01-18 13:17:52)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r1096 \cu(Mon 22 Jan 18:35:54 CET 2024)\c-";
SWWM_SHORTVER="\cw1.3pre r1096 \cu(2024-01-22 18:35:54)\c-";

View File

@ -127,7 +127,7 @@ extend Class SWWMUtility
str.AppendCharacter(cp1);
if ( i < len-1 )
{
int cp2 = workstr.GetNextCodePoint(pos);
let [cp2, pos2] = workstr.GetNextCodePoint(pos);
// this looks awkward, but I have to also account for non-letter characters
// uppercase after lowercase
if ( (String.CharUpper(cp1) != cp1) && (String.CharLower(cp2) != cp2) )
@ -135,9 +135,19 @@ extend Class SWWMUtility
// uppercase after non-letter
else if ( (String.CharUpper(cp1) == cp1) && (String.CharLower(cp1) == cp1) && (String.CharLower(cp2) != cp2) )
str.AppendCharacter(0x20);
// lowercase after non-letter
if ( (String.CharUpper(cp1) == cp1) && (String.CharLower(cp1) == cp1) && (String.CharUpper(cp2) != cp2) )
str.AppendCharacter(0x20);
// non-letter after lowercase
else if ( (String.CharUpper(cp1) != cp1) && (String.CharLower(cp2) == cp2) && (String.CharUpper(cp2) == cp2) )
str.AppendCharacter(0x20);
if ( i < len-2 )
{
let [cp3, pos3] = workstr.GetNextCodePoint(pos2);
// uppercase before uppercase before lowercase
if ( (String.CharLower(cp1) != cp1) && (String.CharLower(cp2) != cp2) && (String.CharUpper(cp3) != cp3) )
str.AppendCharacter(0x20);
}
}
}
}