Skip to content

Commit d017e86

Browse files
committed
支持lua5.2以上字符串分行\z和luajit uul整数类型
1 parent 433a473 commit d017e86

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

LuaParser/src/LuaTokenParser.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,11 +580,25 @@ LuaTokenType LuaTokenParser::readNumeral()
580580

581581
if (lislalpha(getCurrentChar())) /* is numeral touching a letter? */
582582
{
583-
saveAndNext();
583+
// luajit
584+
if(checkNext1('U'))
585+
{
586+
if(checkNext1('U') && checkNext1('L'))
587+
{
588+
return TK_INT;
589+
}
590+
else
591+
{
592+
luaError("unknown integer type", TextRange(_currentParseIndex, _currentParseIndex));
593+
}
594+
}
595+
else {
596+
saveAndNext();
597+
}
584598
}
585599

586600
// todo error format check
587-
601+
// 实际上应该是TK_NUMBER
588602
return TK_INT;
589603
}
590604

0 commit comments

Comments
 (0)