28#define next(ls) (ls->current = zgetc(ls->z))
32#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r')
37 "and",
"break",
"do",
"else",
"elseif",
38 "end",
"false",
"for",
"function",
"goto",
"if",
39 "in",
"local",
"nil",
"not",
"or",
"repeat",
40 "return",
"then",
"true",
"until",
"while",
41 "..",
"...",
"==",
">=",
"<=",
"~=",
"::",
"<eof>",
42 "<number>",
"<name>",
"<string>"
46#define save_and_next(ls) (save(ls, ls->current), next(ls))
57 lexerror(ls,
"lexical element too long", 0);
155 lexerror(ls,
"chunk has too many lines", 0);
200 if (p[n] == from) p[n] = to;
204#if !defined(getlocaledecpoint)
205#define getlocaledecpoint() (localeconv()->decimal_point[0])
209#define buff2d(b,e) luaO_str2d(luaZ_buffer(b), luaZ_bufflen(b) - 1, e)
233 const char *expo =
"Ee";
266 return (ls->
current ==
s) ? count : (-count) - 1;
277 lexerror(ls, (seminfo) ?
"unfinished long string" :
278 "unfinished long comment",
TK_EOS);
287 case '\n':
case '\r': {
309 for (i = 0; i < n && c[i] !=
EOZ; i++)
319 for (i = 1; i < 3; i++) {
322 escerror(ls, c, i + 1,
"hexadecimal digit expected");
334 r = 10*r + c[i] -
'0';
338 escerror(ls, c, i,
"decimal escape too large");
358 case 'a': c =
'\a';
goto read_save;
359 case 'b': c =
'\b';
goto read_save;
360 case 'f': c =
'\f';
goto read_save;
361 case 'n': c =
'\n';
goto read_save;
362 case 'r': c =
'\r';
goto read_save;
363 case 't': c =
'\t';
goto read_save;
364 case 'v': c =
'\v';
goto read_save;
366 case '\n':
case '\r':
368 case '\\':
case '\"':
case '\'':
369 c = ls->
current;
goto read_save;
370 case EOZ:
goto no_save;
388 only_save:
save(ls, c);
405 case '\n':
case '\r': {
409 case ' ':
case '\f':
case '\t':
case '\v': {
415 if (ls->
current !=
'-')
return '-';
438 else if (sep == -1)
return '[';
443 if (ls->
current !=
'=')
return '=';
448 if (ls->
current !=
'=')
return '<';
453 if (ls->
current !=
'=')
return '>';
458 if (ls->
current !=
'=')
return '~';
463 if (ls->
current !=
':')
return ':';
466 case '"':
case '\'': {
480 case '0':
case '1':
case '2':
case '3':
case '4':
481 case '5':
case '6':
case '7':
case '8':
case '9': {
void luaD_throw(lua_State *L, int errcode)
void luaO_chunkid(char *out, const char *source, size_t bufflen)
const char * luaO_pushfstring(lua_State *L, const char *fmt,...)
#define setbvalue(obj, x)
TString * luaS_newlstr(lua_State *L, const char *str, size_t l)
TValue * luaH_set(lua_State *L, Table *t, const TValue *key)
#define luaZ_sizebuffer(buff)
#define luaZ_bufflen(buff)
#define luaZ_resetbuffer(buff)
#define luaZ_buffer(buff)
#define luaZ_resizebuffer(L, buff, size)
void luaX_setinput(lua_State *L, LexState *ls, ZIO *z, TString *source, int firstchar)
static const char *const luaX_tokens[]
static void save(LexState *ls, int c)
static void read_numeral(LexState *ls, SemInfo *seminfo)
static void trydecpoint(LexState *ls, SemInfo *seminfo)
static void read_long_string(LexState *ls, SemInfo *seminfo, int sep)
#define getlocaledecpoint()
static void escerror(LexState *ls, int *c, int n, const char *msg)
void luaX_init(lua_State *L)
TString * luaX_newstring(LexState *ls, const char *str, size_t l)
static int readhexaesc(LexState *ls)
static void read_string(LexState *ls, int del, SemInfo *seminfo)
static int check_next(LexState *ls, const char *set)
static l_noret lexerror(LexState *ls, const char *msg, int token)
static int llex(LexState *ls, SemInfo *seminfo)
static int readdecesc(LexState *ls)
void luaX_next(LexState *ls)
l_noret luaX_syntaxerror(LexState *ls, const char *msg)
static void buffreplace(LexState *ls, char from, char to)
static void inclinenumber(LexState *ls)
#define save_and_next(ls)
static int skip_sep(LexState *ls)
static const char * txtToken(LexState *ls, int token)
const char * luaX_token2str(LexState *ls, int token)
#define currIsNewline(ls)
int luaX_lookahead(LexState *ls)
int luaO_hexavalue(int c)
CURL_EXTERN CURLMcode curl_socket_t s