fix(developer): handle comment without trailing whitespace

Fixes: #12070
Test-bot: skip
This commit is contained in:
Marc Durdin 2026-08-31 10:07:00 +02:00
parent f8a5164c57
commit 4c2ba9f8e0
2 changed files with 2 additions and 2 deletions

View file

@ -2079,7 +2079,7 @@ int LineTokenType(PKMX_WCHAR *str)
switch (towupper(*p))
{
case 'C':
if (iswspace(*(p + 1))) return T_COMMENT;
if (iswspace(*(p + 1)) || *(p + 1) == 0) return T_COMMENT;
break;
case 0:
return T_BLANK;

View file

@ -663,7 +663,7 @@ TEST_F(CompilerTest, LineTokenType_test) {
// comment without following space ... potential bug, but ReadLine() currently ensures following space
u16cpy(str, u"c");
p = str;
EXPECT_EQ(T_UNKNOWN, LineTokenType(&p));
EXPECT_EQ(T_COMMENT, LineTokenType(&p));
EXPECT_EQ(0, p - str);
// T_KEYTOKEY