32 #define next(ls) (ls->current = zgetc(ls->z)) 36 #define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r') 41 "and",
"break",
"do",
"else",
"elseif",
42 "end",
"false",
"for",
"function",
"goto",
"if",
43 "in",
"local",
"nil",
"not",
"or",
"repeat",
44 "return",
"then",
"true",
"until",
"while",
45 "//",
"..",
"...",
"==",
">=",
"<=",
"~=",
46 "<<",
">>",
"::",
"<eof>",
47 "<number>",
"<integer>",
"<name>",
"<string>" 51 #define save_and_next(ls) (save(ls, ls->current), next(ls)) 62 lexerror(ls,
"lexical element too long", 0);
160 lexerror(ls,
"chunk has too many lines", 0);
226 const char *expo =
"Ee";
270 return (ls->
current == s) ? count + 2
284 const char *what = (seminfo ?
"string" :
"comment");
286 "unfinished long %s (starting at line %d)", what, line);
297 case '\n':
case '\r': {
347 esccheck(ls, r <= (0x7FFFFFFFu >> 4),
"UTF-8 value too large");
372 esccheck(ls, r <= UCHAR_MAX,
"decimal escape too large");
393 case 'a': c =
'\a';
goto read_save;
394 case 'b': c =
'\b';
goto read_save;
395 case 'f': c =
'\f';
goto read_save;
396 case 'n': c =
'\n';
goto read_save;
397 case 'r': c =
'\r';
goto read_save;
398 case 't': c =
'\t';
goto read_save;
399 case 'v': c =
'\v';
goto read_save;
401 case 'u':
utf8esc(ls);
goto no_save;
402 case '\n':
case '\r':
404 case '\\':
case '\"':
case '\'':
405 c = ls->
current;
goto read_save;
406 case EOZ:
goto no_save;
445 case '\n':
case '\r': {
449 case ' ':
case '\f':
case '\t':
case '\v': {
455 if (ls->
current !=
'-')
return '-';
514 case '"':
case '\'': {
528 case '0':
case '1':
case '2':
case '3':
case '4':
529 case '5':
case '6':
case '7':
case '8':
case '9': {
void luaX_init(lua_State *L)
static void save(LexState *ls, int c)
#define luaZ_resetbuffer(buff)
l_noret luaX_syntaxerror(LexState *ls, const char *msg)
const char * luaG_addinfo(lua_State *L, const char *msg, TString *src, int line)
static int llex(LexState *ls, SemInfo *seminfo)
static l_noret lexerror(LexState *ls, const char *msg, int token)
#define luaZ_buffremove(buff, i)
static int check_next2(LexState *ls, const char *set)
static const char *const luaX_tokens[]
TString * luaS_newlstr(lua_State *L, const char *str, size_t l)
void luaC_fix(lua_State *L, GCObject *o)
static void inclinenumber(LexState *ls)
#define luaZ_resizebuffer(L, buff, size)
#define luaS_newliteral(L, s)
#define save_and_next(ls)
const char * luaX_token2str(LexState *ls, int token)
static void utf8esc(LexState *ls)
void luaX_next(LexState *ls)
TValue * luaH_set(lua_State *L, Table *t, const TValue *key)
static int check_next1(LexState *ls, int c)
static int readdecesc(LexState *ls)
#define setsvalue2s(L, o, s)
TString * luaX_newstring(LexState *ls, const char *str, size_t l)
int luaO_hexavalue(int c)
int luaX_lookahead(LexState *ls)
TString * luaS_new(lua_State *L, const char *str)
#define currIsNewline(ls)
static void esccheck(LexState *ls, int c, const char *msg)
static void read_long_string(LexState *ls, SemInfo *seminfo, size_t sep)
static int gethexa(LexState *ls)
void luaX_setinput(lua_State *L, LexState *ls, ZIO *z, TString *source, int firstchar)
static int readhexaesc(LexState *ls)
static int read_numeral(LexState *ls, SemInfo *seminfo)
static unsigned long readutf8esc(LexState *ls)
#define luaZ_sizebuffer(buff)
int luaO_utf8esc(char *buff, unsigned long x)
const char * luaO_pushfstring(lua_State *L, const char *fmt,...)
size_t luaO_str2num(const char *s, TValue *o)
static const char * txtToken(LexState *ls, int token)
static size_t skip_sep(LexState *ls)
#define luaZ_bufflen(buff)
l_noret luaD_throw(lua_State *L, int errcode)
#define luaZ_buffer(buff)
static void read_string(LexState *ls, int del, SemInfo *seminfo)