So love.js doesn't support goto?

Discuss any ports of LÖVE to different platforms.
Post Reply
User avatar
Gunroar:Cannon()
Party member
Posts: 1150
Joined: Thu Dec 10, 2020 1:57 am

So love.js doesn't support goto?

Post by Gunroar:Cannon() »

I just tried to port one of my games to love.js (I used makelove to build) but it turns out it gives a syntax error for goto since it uses an old version of lua(?). My "engine" (a looot of reused code and libs in a folder) use gotos probably quite often. Is there truly no workaround but to rewrite aaall those sections?
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
dusoft
Party member
Posts: 765
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: So love.js doesn't support goto?

Post by dusoft »

OT: "Gotos baaad"
User avatar
pgimeno
Party member
Posts: 3709
Joined: Sun Oct 18, 2015 2:58 pm

Re: So love.js doesn't support goto?

Post by pgimeno »

goto is a Lua 5.2 thing, and LuaJIT implements it as an extension. However, love.js can't run LuaJIT and runs PUC Lua 5.1 instead, as far as I know, so I'm afraid you're out of luck.

You can always try to compile your own PUC Lua 5.1 backporting the goto extension from 5.2, but I guess that's not an option for you. The only remaining one is to hope that some time in the future, LuaJIT implements WebAssembly.
User avatar
Gunroar:Cannon()
Party member
Posts: 1150
Joined: Thu Dec 10, 2020 1:57 am

Re: So love.js doesn't support goto?

Post by Gunroar:Cannon() »

Yeah, thanks everyone. It seems gotos really are bad overall. I only had like 5 in my whole +100 file code base I think.l, so even libraries don't use it that much.
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests