Lines Matching refs:token
54 static l_noret lexerror (LexState *ls, const char *msg, int token);
82 const char *luaX_token2str (LexState *ls, int token) {
83 if (token < FIRST_RESERVED) { /* single-byte symbols? */
84 if (lisprint(token))
85 return luaO_pushfstring(ls->L, "'%c'", token);
87 return luaO_pushfstring(ls->L, "'<\\%d>'", token);
90 const char *s = luaX_tokens[token - FIRST_RESERVED];
91 if (token < TK_EOS) /* fixed format (symbols and reserved words)? */
99 static const char *txtToken (LexState *ls, int token) {
100 switch (token) {
106 return luaX_token2str(ls, token);
111 static l_noret lexerror (LexState *ls, const char *msg, int token) {
113 if (token)
114 luaO_pushfstring(ls->L, "%s near %s", msg, txtToken(ls, token));
120 lexerror(ls, msg, ls->t.token);
166 ls->t.token = 0;
169 ls->lookahead.token = TK_EOS; /* no look-ahead token */
564 if (ls->lookahead.token != TK_EOS) { /* is there a look-ahead token? */
566 ls->lookahead.token = TK_EOS; /* and discharge it */
569 ls->t.token = llex(ls, &ls->t.seminfo); /* read next token */
574 lua_assert(ls->lookahead.token == TK_EOS);
575 ls->lookahead.token = llex(ls, &ls->lookahead.seminfo);
576 return ls->lookahead.token;