From ee4859b3e3db6c1a3223669d15538b3852ca4791 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 22 Apr 2002 11:40:50 -0300 Subject: new way to handle errors (temporary version) --- lua.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lua.c') diff --git a/lua.c b/lua.c index 03cfbb9d..fbeaf239 100644 --- a/lua.c +++ b/lua.c @@ -1,5 +1,5 @@ /* -** $Id: lua.c,v 1.81 2002/04/05 18:54:31 roberto Exp roberto $ +** $Id: lua.c,v 1.82 2002/04/09 20:19:06 roberto Exp roberto $ ** Lua stand-alone interpreter ** See Copyright Notice in lua.h */ @@ -200,16 +200,16 @@ static int trap_eof (lua_State *l) { static int load_string (void) { - lua_getglobal(L, LUA_ERRORMESSAGE); + lua_getglobal(L, "_ERRORMESSAGE"); lua_pushvalue(L, 1); - lua_setglobal(L, LUA_ERRORMESSAGE); + lua_setglobal(L, "_ERRORMESSAGE"); incomplete = 0; for (;;) { /* repeat until gets a complete line */ int result; char *buffer = readline(get_prompt(incomplete)); if (buffer == NULL) { /* input end? */ lua_settop(L, 2); - lua_setglobal(L, LUA_ERRORMESSAGE); + lua_setglobal(L, "_ERRORMESSAGE"); return 0; } if (!incomplete && buffer[0] == '=') { @@ -225,7 +225,7 @@ static int load_string (void) { lua_remove(L, 3); if (result == 0) { lua_insert(L, 2); /* swap compiled chunk with old _ERRORMESSAGE */ - lua_setglobal(L, LUA_ERRORMESSAGE); /* restore old _ERRORMESSAGE */ + lua_setglobal(L, "_ERRORMESSAGE"); /* restore old _ERRORMESSAGE */ return 1; } else -- cgit v1.2.3-55-g6feb