mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-04 14:47:42 +00:00
fix(developer): handle comment without trailing whitespace
Fixes: #12070 Test-bot: skip
This commit is contained in:
parent
f8a5164c57
commit
4c2ba9f8e0
2 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue