commit 8502331f69a3a13bce0b2afca36dd3f607eb3696
parent 9914e1bcddfb7ba0e5b4597a0540df8ec3111b3f
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 20 Oct 2003 10:24:12 -0200
`luaX_errorline' was used only in one place
Diffstat:
2 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/llex.c b/llex.c
@@ -1,5 +1,5 @@
/*
-** $Id: llex.c,v 1.126 2003/10/03 16:05:34 roberto Exp roberto $
+** $Id: llex.c,v 1.127 2003/10/03 16:07:44 roberto Exp roberto $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@@ -69,20 +69,6 @@ void luaX_checklimit (LexState *ls, int val, int limit, const char *msg) {
}
-void luaX_errorline (LexState *ls, const char *s, const char *token, int line) {
- lua_State *L = ls->L;
- char buff[MAXSRC];
- luaO_chunkid(buff, getstr(ls->source), MAXSRC);
- luaO_pushfstring(L, "%s:%d: %s near `%s'", buff, line, s, token);
- luaD_throw(L, LUA_ERRSYNTAX);
-}
-
-
-static void luaX_error (LexState *ls, const char *s, const char *token) {
- luaX_errorline(ls, s, token, ls->linenumber);
-}
-
-
const char *luaX_token2str (LexState *ls, int token) {
if (token < FIRST_RESERVED) {
lua_assert(token == (unsigned char)token);
@@ -108,7 +94,11 @@ static const char *txtToken (LexState *ls, int token) {
static void luaX_lexerror (LexState *ls, const char *msg, int token) {
- luaX_error(ls, msg, txtToken(ls, token));
+ char buff[MAXSRC];
+ luaO_chunkid(buff, getstr(ls->source), MAXSRC);
+ luaO_pushfstring(ls->L, "%s:%d: %s near `%s'",
+ buff, ls->linenumber, msg, txtToken(ls, token));
+ luaD_throw(ls->L, LUA_ERRSYNTAX);
}
diff --git a/llex.h b/llex.h
@@ -1,5 +1,5 @@
/*
-** $Id: llex.h,v 1.47 2003/02/28 17:19:47 roberto Exp roberto $
+** $Id: llex.h,v 1.48 2003/08/27 21:01:44 roberto Exp roberto $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@@ -69,7 +69,6 @@ TString *luaX_newstring (LexState *LS, const char *str, size_t l);
int luaX_lex (LexState *LS, SemInfo *seminfo);
void luaX_checklimit (LexState *ls, int val, int limit, const char *msg);
void luaX_syntaxerror (LexState *ls, const char *s);
-void luaX_errorline (LexState *ls, const char *s, const char *token, int line);
const char *luaX_token2str (LexState *ls, int token);