Re: Inconsistent Multiline String Handling in Lua REPL (Direct Input vs. History Recall)

mathieu stumpf-guntz <[email protected]> Thu, 30 Jul 2026 09:05:04 -0700 (PDT)
Newsgroups gmane.comp.lang.lua.general
Message-ID <[email protected]>
------=_Part_56576_2009061290.1785427504021
Content-Type: multipart/alternative; 
	boundary="----=_Part_56577_542878030.1785427504021"

------=_Part_56577_542878030.1785427504021
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello Martin, thanks for your additional insights.=20

Works on my machine:=20

  $ lua=20
  Lua 5.5.1  Copyright (C) 1994-2026 Lua.org, PUC-Rio=20
  > [[ \ntest\n]]=20
   \ntest\n=20
  >=20


Could test quickly 5.5.1 using `mise`, latest it enabled me to try was=20
5.5.0 where I got:

$lua=20
Lua 5.5.0 Copyright (C) 1994-2025 Lua.org, PUC-Rio
> [[
>> ]]
stdin:2: unexpected symbol near '[[]]'

>BTW there are no magic (cursed) sequences in long Lua literals.=20

Not sure what you mean here, but in my previous examples I didn=E2=80=99t m=
ean I=20
used any magic sequence, the "\n" was actually literal new lines. So to=20
make it clear, the test conducted was more like `echo -e '[[\ntest\n]]' |=
=20
lua`,  which ends up (in all configurations I was able to try) with
lua: stdin:3: unexpected symbol near '[[test
]]'

--=20
You received this message because you are subscribed to the Google Groups "=
lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/32068=
0f9-4719-4007-b053-c28305616fbdn%40googlegroups.com.

------=_Part_56577_542878030.1785427504021
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div>Hello Martin, thanks for your additional insights.=C2=A0</div><div><br=
 /></div><div><blockquote style=3D"margin: 0px 0px 0px 0.8ex; border-left: =
1px solid rgb(204, 204, 204); padding-left: 1ex;">Works on my machine:
<br />
<br /> =C2=A0 $ lua
<br /> =C2=A0 Lua 5.5.1=C2=A0 Copyright (C) 1994-2026 Lua.org, PUC-Rio
<br /> =C2=A0 &gt; [[ \ntest\n]]
<br /> =C2=A0 =C2=A0\ntest\n
<br /> =C2=A0 &gt;
<br /></blockquote><div><br /></div><div>Could test quickly 5.5.1 using `mi=
se`, latest it enabled me to try was 5.5.0 where I got:<br /><br /><div sty=
le=3D"background-color: rgb(30, 31, 34); color: rgb(188, 190, 196);"><span =
style=3D"font-family: &quot;JetBrains Mono&quot;, monospace;">$<span style=
=3D"color: rgb(85, 148, 250);">lua</span>=C2=A0<br />Lua 5.5.0  Copyright (=
C) 1994-2025 Lua.org, PUC-Rio<br />&gt; [[<br />&gt;&gt; ]]<br />stdin:2: u=
nexpected symbol near '[[]]'</span></div><br />&gt;BTW there are no magic (=
cursed) sequences in long Lua literals.
<br /><br /></div><div>Not sure what you mean here, but in my previous exam=
ples I didn=E2=80=99t mean I used any magic sequence, the "\n" was actually=
 literal new lines. So to make it clear, the test conducted was more like `=
echo -e '[[\ntest\n]]' | lua`,=C2=A0 which ends up (in all configurations I=
 was able to try) with<div style=3D"background-color: rgb(30, 31, 34); colo=
r: rgb(188, 190, 196);"><span style=3D"font-family: &quot;JetBrains Mono&qu=
ot;, monospace;">lua: stdin:3: unexpected symbol near '[[test<br />]]'</spa=
n></div></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;lua-l&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">lua-l+unsubsc=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
lua-l/320680f9-4719-4007-b053-c28305616fbdn%40googlegroups.com?utm_medium=
=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/lua-l/32068=
0f9-4719-4007-b053-c28305616fbdn%40googlegroups.com</a>.<br />

------=_Part_56577_542878030.1785427504021--

------=_Part_56576_2009061290.1785427504021--