Lines Matching refs:token
49 static l_noret lexerror (LexState *ls, const char *msg, int token);
75 const char *luaX_token2str (LexState *ls, int token) {
76 if (token < FIRST_RESERVED) { /* single-byte symbols? */
77 lua_assert(token == cast(unsigned char, token));
78 return (lisprint(token)) ? luaO_pushfstring(ls->L, LUA_QL("%c"), token) :
79 luaO_pushfstring(ls->L, "char(%d)", token);
82 const char *s = luaX_tokens[token - FIRST_RESERVED];
83 if (token < TK_EOS) /* fixed format (symbols and reserved words)? */
91 static const char *txtToken (LexState *ls, int token) {
92 switch (token) {
99 return luaX_token2str(ls, token);
104 static l_noret lexerror (LexState *ls, const char *msg, int token) {
108 if (token)
109 luaO_pushfstring(ls->L, "%s near %s", msg, txtToken(ls, token));
115 lexerror(ls, msg, ls->t.token);
161 ls->lookahead.token = TK_EOS; /* no look-ahead token */
513 if (ls->lookahead.token != TK_EOS) { /* is there a look-ahead token? */
515 ls->lookahead.token = TK_EOS; /* and discharge it */
518 ls->t.token = llex(ls, &ls->t.seminfo); /* read next token */
523 lua_assert(ls->lookahead.token == TK_EOS);
524 ls->lookahead.token = llex(ls, &ls->lookahead.seminfo);
525 return ls->lookahead.token;