Removed compatibility with "= exp" in the REPL

This commit is contained in:
Roberto Ierusalimschy committed 2024-07-05 15:19:11 -03:00
1 parent 93fd6892f8
commit 6b45ccf4ed
2 files changed
+1 -4

No files matched your search

-3
View File
@@ -565,9 +565,6 @@ static int pushline (lua_State *L, int firstline) {
l = strlen(b); l = strlen(b);
if (l > 0 && b[l-1] == '\n') /* line ends with newline? */ if (l > 0 && b[l-1] == '\n') /* line ends with newline? */
b[--l] = '\0'; /* remove it */ b[--l] = '\0'; /* remove it */
if (firstline && b[0] == '=') /* for compatibility with 5.2, ... */
lua_pushfstring(L, "return %s", b + 1); /* change '=' to 'return' */
else
lua_pushlstring(L, b, l); lua_pushlstring(L, b, l);
lua_freeline(b); lua_freeline(b);
return 1; return 1;
+1 -1
View File
@@ -345,7 +345,7 @@ a]]
RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out) RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
checkprogout("6\n10\n10\n\n") checkprogout("6\n10\n10\n\n")
prepfile("a = [[b\nc\nd\ne]]\n=a") prepfile("a = [[b\nc\nd\ne]]\na")
RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out) RUN([[lua -e"_PROMPT='' _PROMPT2=''" -i < %s > %s]], prog, out)
checkprogout("b\nc\nd\ne\n\n") checkprogout("b\nc\nd\ne\n\n")