diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-16 18:19:00 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-05-16 18:19:00 -0300 |
commit | c2bb9abceceef125554595e23b7cc18ad3555c7c (patch) | |
tree | 2c00262ddf0e4f8acc1db83bdee4a56bb2458117 /lua.c | |
parent | da32450c3d4c8abd3fd6709692859a12a8886511 (diff) | |
download | lua-c2bb9abceceef125554595e23b7cc18ad3555c7c.tar.gz lua-c2bb9abceceef125554595e23b7cc18ad3555c7c.tar.bz2 lua-c2bb9abceceef125554595e23b7cc18ad3555c7c.zip |
better quotes for strings in error messages
Diffstat (limited to 'lua.c')
-rw-r--r-- | lua.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.c,v 1.141 2005/04/11 18:01:35 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.142 2005/04/13 17:24:20 roberto Exp roberto $ |
3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -44,9 +44,9 @@ static void print_usage (void) { | |||
44 | "usage: %s [options] [script [args]].\n" | 44 | "usage: %s [options] [script [args]].\n" |
45 | "Available options are:\n" | 45 | "Available options are:\n" |
46 | " - execute stdin as a file\n" | 46 | " - execute stdin as a file\n" |
47 | " -e stat execute string `stat'\n" | 47 | " -e stat execute string 'stat'\n" |
48 | " -i enter interactive mode after executing `script'\n" | 48 | " -i enter interactive mode after executing 'script'\n" |
49 | " -l name require library `name'\n" | 49 | " -l name require library 'name'\n" |
50 | " -v show version information\n" | 50 | " -v show version information\n" |
51 | " -w trap access to undefined globals\n" | 51 | " -w trap access to undefined globals\n" |
52 | " -- stop handling options\n" , | 52 | " -- stop handling options\n" , |
@@ -149,7 +149,7 @@ static const char *get_prompt (lua_State *L, int firstline) { | |||
149 | 149 | ||
150 | static int incomplete (lua_State *L, int status) { | 150 | static int incomplete (lua_State *L, int status) { |
151 | if (status == LUA_ERRSYNTAX && | 151 | if (status == LUA_ERRSYNTAX && |
152 | strstr(lua_tostring(L, -1), "near `<eof>'") != NULL) { | 152 | strstr(lua_tostring(L, -1), "<eof>") != NULL) { |
153 | lua_pop(L, 1); | 153 | lua_pop(L, 1); |
154 | return 1; | 154 | return 1; |
155 | } | 155 | } |
@@ -209,7 +209,7 @@ static void dotty (lua_State *L) { | |||
209 | lua_getglobal(L, "print"); | 209 | lua_getglobal(L, "print"); |
210 | lua_insert(L, 1); | 210 | lua_insert(L, 1); |
211 | if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != 0) | 211 | if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != 0) |
212 | l_message(progname, lua_pushfstring(L, "error calling `print' (%s)", | 212 | l_message(progname, lua_pushfstring(L, "error calling 'print' (%s)", |
213 | lua_tostring(L, -1))); | 213 | lua_tostring(L, -1))); |
214 | } | 214 | } |
215 | } | 215 | } |
@@ -222,7 +222,7 @@ static void dotty (lua_State *L) { | |||
222 | static int checkvar (lua_State *L) { | 222 | static int checkvar (lua_State *L) { |
223 | const char *name = lua_tostring(L, 2); | 223 | const char *name = lua_tostring(L, 2); |
224 | if (name) | 224 | if (name) |
225 | luaL_error(L, "attempt to access undefined variable `%s'", name); | 225 | luaL_error(L, "attempt to access undefined variable " LUA_SM, name); |
226 | return 0; | 226 | return 0; |
227 | } | 227 | } |
228 | 228 | ||