Lines Matching refs:token
46 static l_noret lexerror (LexState *ls, const char *msg, int token);
72 const char *luaX_token2str (LexState *ls, int token) {
73 if (token < FIRST_RESERVED) { /* single-byte symbols? */
74 lua_assert(token == cast(unsigned char, token));
75 return (lisprint(token)) ? luaO_pushfstring(ls->L, LUA_QL("%c"), token) :
76 luaO_pushfstring(ls->L, "char(%d)", token);
79 const char *s = luaX_tokens[token - FIRST_RESERVED];
80 if (token < TK_EOS) /* fixed format (symbols and reserved words)? */
88 static const char *txtToken (LexState *ls, int token) {
89 switch (token) {
96 return luaX_token2str(ls, token);
101 static l_noret lexerror (LexState *ls, const char *msg, int token) {
105 if (token)
106 luaO_pushfstring(ls->L, "%s near %s", msg, txtToken(ls, token));
112 lexerror(ls, msg, ls->t.token);
161 ls->lookahead.token = TK_EOS; /* no look-ahead token */
517 if (ls->lookahead.token != TK_EOS) { /* is there a look-ahead token? */
519 ls->lookahead.token = TK_EOS; /* and discharge it */
522 ls->t.token = llex(ls, &ls->t.seminfo); /* read next token */
527 lua_assert(ls->lookahead.token == TK_EOS);
528 ls->lookahead.token = llex(ls, &ls->lookahead.seminfo);
529 return ls->lookahead.token;