add SkipWhite function
This commit is contained in:
parent
0a5ab301d1
commit
244eabbebf
|
@ -67,6 +67,7 @@ char *LT_ReadNumber();
|
|||
char *LT_ReadString(char term);
|
||||
char *LT_Escaper(char *str, size_t pos, char escape);
|
||||
LT_Token LT_GetToken();
|
||||
void LT_SkipWhite();
|
||||
]])
|
||||
|
||||
local pReturn
|
||||
|
@ -141,4 +142,8 @@ function tokenizer:setPos(newPos)
|
|||
tokenizer:checkError()
|
||||
end
|
||||
|
||||
function tokenizer:skipWhite()
|
||||
loveToken.LT_SkipWhite()
|
||||
end
|
||||
|
||||
return tokenizer
|
||||
|
|
11
src/lt.c
11
src/lt.c
|
@ -878,3 +878,14 @@ LT_Token LT_GetToken()
|
|||
return tk;
|
||||
}
|
||||
|
||||
void LT_SkipWhite()
|
||||
{
|
||||
char c = fgetc(parseFile);
|
||||
|
||||
while(isspace(c) && c != EOF)
|
||||
{
|
||||
c = fgetc(parseFile);
|
||||
}
|
||||
|
||||
ungetc(c, parseFile);
|
||||
}
|
||||
|
|
Reference in New Issue
Block a user