20 #define FIRST_RESERVED (UCHAR_MAX + 1) 24 #define LUA_ENV "_ENV" 34 TK_AND = FIRST_RESERVED, TK_BREAK,
35 TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION,
36 TK_GOTO, TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT,
37 TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE,
39 TK_IDIV, TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE,
42 TK_FLT, TK_INT, TK_NAME, TK_STRING
46 #define NUM_RESERVED (cast_int(TK_WHILE-FIRST_RESERVED + 1)) 56 typedef struct Token {
64 typedef struct LexState {
81 LUAI_FUNC
void luaX_init (lua_State *L);
82 LUAI_FUNC
void luaX_setinput (lua_State *L, LexState *ls, ZIO *z,
83 TString *source,
int firstchar);
84 LUAI_FUNC TString *luaX_newstring (LexState *ls,
const char *str,
size_t l);
85 LUAI_FUNC
void luaX_next (LexState *ls);
86 LUAI_FUNC
int luaX_lookahead (LexState *ls);
87 LUAI_FUNC l_noret luaX_syntaxerror (LexState *ls,
const char *s);
88 LUAI_FUNC
const char *luaX_token2str (LexState *ls,
int token);