27 #define next(ls) (ls->current = zgetc(ls->z))
31 #define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r')
36 "and",
"break",
"do",
"else",
"elseif",
37 "end",
"false",
"for",
"function",
"goto",
"if",
38 "in",
"local",
"nil",
"not",
"or",
"repeat",
39 "return",
"then",
"true",
"until",
"while",
40 "..",
"...",
"==",
">=",
"<=",
"~=",
"::",
"<eof>",
41 "<number>",
"<name>",
"<string>"
45 #define save_and_next(ls) (save(ls, ls->current), next(ls))
56 lexerror(ls,
"lexical element too long", 0);
199 if (p[n] == from) p[
n] = to;
203 #if !defined(getlocaledecpoint)
204 #define getlocaledecpoint() (localeconv()->decimal_point[0])
208 #define buff2d(b,e) luaO_str2d(luaZ_buffer(b), luaZ_bufflen(b) - 1, e)
232 const char *expo =
"Ee";
276 lexerror(ls, (seminfo) ?
"unfinished long string" :
277 "unfinished long comment",
TK_EOS);
286 case '\n':
case '\r': {
308 for (i = 0; i < n && c[
i] !=
EOZ; i++)
318 for (i = 1; i < 3; i++) {
321 escerror(ls, c, i + 1,
"hexadecimal digit expected");
333 r = 10*r + c[
i] -
'0';
337 escerror(ls, c, i,
"decimal escape too large");
357 case 'a': c =
'\a';
goto read_save;
358 case 'b': c =
'\b';
goto read_save;
359 case 'f': c =
'\f';
goto read_save;
360 case 'n': c =
'\n';
goto read_save;
361 case 'r': c =
'\r';
goto read_save;
362 case 't': c =
'\t';
goto read_save;
363 case 'v': c =
'\v';
goto read_save;
365 case '\n':
case '\r':
367 case '\\':
case '\"':
case '\'':
368 c = ls->
current;
goto read_save;
369 case EOZ:
goto no_save;
387 only_save:
save(ls, c);
404 case '\n':
case '\r': {
408 case ' ':
case '\f':
case '\t':
case '\v': {
414 if (ls->
current !=
'-')
return '-';
437 else if (sep == -1)
return '[';
442 if (ls->
current !=
'=')
return '=';
447 if (ls->
current !=
'=')
return '<';
452 if (ls->
current !=
'=')
return '>';
457 if (ls->
current !=
'=')
return '~';
462 if (ls->
current !=
':')
return ':';
465 case '"':
case '\'': {
479 case '0':
case '1':
case '2':
case '3':
case '4':
480 case '5':
case '6':
case '7':
case '8':
case '9': {
#define luaZ_resetbuffer(buff)
#define currIsNewline(ls)
void luaX_next(LexState *ls)
void set(CURSOR_TYPE type)
Use the default parameter to reset cursors.
static void read_numeral(LexState *ls, SemInfo *seminfo)
#define setbvalue(obj, x)
TValue * luaH_set(lua_State *L, Table *t, const TValue *key)
l_noret luaX_syntaxerror(LexState *ls, const char *msg)
TString * luaS_new(lua_State *L, const char *str)
#define luaZ_resizebuffer(L, buff, size)
GLdouble GLdouble GLdouble b
static void read_long_string(LexState *ls, SemInfo *seminfo, int sep)
TString * luaX_newstring(LexState *ls, const char *str, size_t l)
static int check_next(LexState *ls, const char *set)
static int skip_sep(LexState *ls)
static const char * txtToken(LexState *ls, int token)
void luaX_setinput(lua_State *L, LexState *ls, ZIO *z, TString *source, int firstchar)
static l_noret lexerror(LexState *ls, const char *msg, int token)
static void read_string(LexState *ls, int del, SemInfo *seminfo)
void luaX_init(lua_State *L)
static int llex(LexState *ls, SemInfo *seminfo)
GLuint GLuint GLsizei count
const char * luaX_token2str(LexState *ls, int token)
l_noret luaD_throw(lua_State *L, int errcode)
static int readhexaesc(LexState *ls)
static const char *const luaX_tokens[]
#define getlocaledecpoint()
static int readdecesc(LexState *ls)
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
GLdouble GLdouble GLdouble r
static void save(LexState *ls, int c)
static void escerror(LexState *ls, int *c, int n, const char *msg)
const char * luaO_pushfstring(lua_State *L, const char *fmt,...)
int luaO_hexavalue(int c)
void luaO_chunkid(char *out, const char *source, size_t bufflen)
int luaX_lookahead(LexState *ls)
static void inclinenumber(LexState *ls)
static void buffreplace(LexState *ls, char from, char to)
static void trydecpoint(LexState *ls, SemInfo *seminfo)
#define luaZ_sizebuffer(buff)
#define save_and_next(ls)
TString * luaS_newlstr(lua_State *L, const char *str, size_t l)
GLsizei GLsizei GLchar * source
#define luaZ_bufflen(buff)
#define luaZ_buffer(buff)