lapis-console icon indicating copy to clipboard operation
lapis-console copied to clipboard

Run the code as Lua instead of moonscript.

Open josellausas opened this issue 9 years ago • 9 comments

When pressing the run button, it sends the ?lang=moonscript parameter. How can I configure the console to use ?lang=lua ?

josellausas avatar Dec 11 '15 15:12 josellausas

did you mean to close this?

leafo avatar Dec 11 '15 18:12 leafo

Yes, I'm not sure this is an issue. It is more a feature request. I decided to fork the lapis-console and attempt to fix it myself. I have changed the lang variable to lua, but my print don't work. Is there an easy way to use the console with lua code instead of moonscript?

josellausas avatar Dec 11 '15 21:12 josellausas

Sure, the change should be really easy, just a couple lines. (Also features requests are okay for the issue tracker)

Looks like it's mostly set up, I just forgot to write the code.

You'll want to do a Lua loadstring similar to how there's a moonscript.loadstring:

https://github.com/leafo/lapis-console/blob/master/lapis/console/init.moon#L96

leafo avatar Dec 12 '15 19:12 leafo

@zunware did you manage to add the feature, can you merge it in/submit a PR? As a Lua newbie I want to use just plain Lua for now.

Somewhat related: https://github.com/leafo/lapis-console/issues/8

lee-kagiso avatar Dec 18 '15 10:12 lee-kagiso

@lee-kagiso: I got it working with a hard-coded solution. I will work on a clean solution and submit it. I haven't submitted code before, so I will have to research that. I can share my hack to make it work with Lua if needed.

josellausas avatar Jan 02 '16 02:01 josellausas

How're you going with this?

vadi2 avatar Apr 08 '16 22:04 vadi2

@lee-kagiso @vadi2 I just pushed the missing code with the changes needed to run code in lua instead of moonscript.

###Note:

You still need to change and uncoment the line 36 inside console/assets/main_js.lua for it to work.

I am a javascript noob and couldn't get a checkbox working for toggling lua/moonscript. If someone can get that working that would be awesome.

josellausas avatar Apr 09 '16 03:04 josellausas

How come this has been closed?

vadi2 avatar Nov 18 '16 21:11 vadi2

my bad. Reopened.

josellausas avatar Nov 18 '16 21:11 josellausas