Skip to content

Commit 6b45ccf

Browse files
committed
Removed compatibility with "= exp" in the REPL
1 parent 93fd689 commit 6b45ccf

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

lua.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,10 +565,7 @@ static int pushline (lua_State *L, int firstline) {
565565
l = strlen(b);
566566
if (l > 0 && b[l-1] == '\n') /* line ends with newline? */
567567
b[--l] = '\0'; /* remove it */
568-
if (firstline && b[0] == '=') /* for compatibility with 5.2, ... */
569-
lua_pushfstring(L, "return %s", b + 1); /* change '=' to 'return' */
570-
else
571-
lua_pushlstring(L, b, l);
568+
lua_pushlstring(L, b, l);
572569
lua_freeline(b);
573570
return 1;
574571
}

testes/main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ a]]
345345
RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
346346
checkprogout("6\n10\n10\n\n")
347347

348-
prepfile("a = [[b\nc\nd\ne]]\n=a")
348+
prepfile("a = [[b\nc\nd\ne]]\na")
349349
RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
350350
checkprogout("b\nc\nd\ne\n\n")
351351

0 commit comments

Comments
 (0)