aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-03-14 12:39:42 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-03-14 12:39:42 -0300
commit682cce3813381305a8c36f9988af10ec33b43d44 (patch)
treede2fdfc050daac8ec96d9b804c14f9176d65e7a7
parentd806710ab5622487159f2a8aecf72003d831542b (diff)
downloadlua-682cce3813381305a8c36f9988af10ec33b43d44.tar.gz
lua-682cce3813381305a8c36f9988af10ec33b43d44.tar.bz2
lua-682cce3813381305a8c36f9988af10ec33b43d44.zip
macro 'mark' renamed 'EOFMARK' ('mark' is too easy to confict, e.g.
in alllua.c)
-rw-r--r--lua.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lua.c b/lua.c
index 6621eaba..c41a32a6 100644
--- a/lua.c
+++ b/lua.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.c,v 1.195 2010/12/03 17:20:50 roberto Exp roberto $ 2** $Id: lua.c,v 1.196 2011/02/07 12:27:13 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*/
@@ -245,14 +245,14 @@ static const char *get_prompt (lua_State *L, int firstline) {
245} 245}
246 246
247/* mark in error messages for incomplete statements */ 247/* mark in error messages for incomplete statements */
248#define mark "<eof>" 248#define EOFMARK "<eof>"
249#define marklen (sizeof(mark) - 1) 249#define marklen (sizeof(EOFMARK) - 1)
250 250
251static int incomplete (lua_State *L, int status) { 251static int incomplete (lua_State *L, int status) {
252 if (status == LUA_ERRSYNTAX) { 252 if (status == LUA_ERRSYNTAX) {
253 size_t lmsg; 253 size_t lmsg;
254 const char *msg = lua_tolstring(L, -1, &lmsg); 254 const char *msg = lua_tolstring(L, -1, &lmsg);
255 if (lmsg >= marklen && strcmp(msg + lmsg - marklen, mark) == 0) { 255 if (lmsg >= marklen && strcmp(msg + lmsg - marklen, EOFMARK) == 0) {
256 lua_pop(L, 1); 256 lua_pop(L, 1);
257 return 1; 257 return 1;
258 } 258 }