that should be adequate
This commit is contained in:
parent
c0c57b3ae8
commit
188e71ccda
|
@ -45,6 +45,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
const char *token;
|
const char *token;
|
||||||
char *string;
|
char *string;
|
||||||
|
int strlen;
|
||||||
int pos;
|
int pos;
|
||||||
} LT_Token;
|
} LT_Token;
|
||||||
|
|
||||||
|
@ -66,7 +67,7 @@ void LT_SetPos(int newPos);
|
||||||
void LT_CloseFile(void);
|
void LT_CloseFile(void);
|
||||||
|
|
||||||
char *LT_ReadNumber(void);
|
char *LT_ReadNumber(void);
|
||||||
char *LT_ReadString(char term);
|
void LT_ReadString(LT_Token *tk, char term);
|
||||||
char *LT_Escaper(char *str, size_t pos, char escape);
|
char *LT_Escaper(char *str, size_t pos, char escape);
|
||||||
LT_Token LT_GetToken(void);
|
LT_Token LT_GetToken(void);
|
||||||
void LT_SkipWhite(void);
|
void LT_SkipWhite(void);
|
||||||
|
@ -114,8 +115,8 @@ function tokenizer:readNumber()
|
||||||
return ffi.string(pReturn)
|
return ffi.string(pReturn)
|
||||||
end
|
end
|
||||||
|
|
||||||
function tokenizer:readString(term)
|
function tokenizer:readString(tk, term)
|
||||||
pReturn = loveToken.LT_ReadString(term)
|
pReturn = loveToken.LT_ReadString(tk, term)
|
||||||
tokenizer:checkError()
|
tokenizer:checkError()
|
||||||
return ffi.string(pReturn)
|
return ffi.string(pReturn)
|
||||||
end
|
end
|
||||||
|
@ -132,6 +133,7 @@ function tokenizer:getToken()
|
||||||
local lt = {}
|
local lt = {}
|
||||||
lt.token = ffi.string(pReturn.token)
|
lt.token = ffi.string(pReturn.token)
|
||||||
lt.string = pReturn.string
|
lt.string = pReturn.string
|
||||||
|
lt.strlen = pReturn.strlen
|
||||||
lt.pos = pReturn.pos
|
lt.pos = pReturn.pos
|
||||||
if (pReturn.string ~= nil) then
|
if (pReturn.string ~= nil) then
|
||||||
lt.string = ffi.string(pReturn.string)
|
lt.string = ffi.string(pReturn.string)
|
||||||
|
|
Reference in New Issue
Block a user