LUA code beautifier wanted!

I worked a lot with flash actionscript and one of the most helpful IDE-function is the auto-indent button. One click and the code is parsed for syntax errors and formatted by an editable set of rules.

so this line:

1
if (foo==bar){ foo=1; bar=2;}else{trace("WTF?!")}

Your looking to convert that line to lua ?

if (foo==bar){ foo=1; bar=2;}else{trace("WTF?!")}

1
2
3
if foo == bar then foo, bar = 1,2 else trace("WTF?!") end
 
?

no.. uhm, I'm looking for a tool that can auto-indent lua code

something that can turn this

1
function foo (bar) if bar == 0 then foobar = 1 end end

Oh my bad :)

Sorry I don't know of one personally :/

The best editor I've found available for free is IntelliJ IDEA editor with the LUA plugin. http://www.jetbrains.com/idea/
It has many great features including a 'code reformat' function that makes your code look great.

Jeff

One more thing, I tried your code with the IntelliJ IDEA editor

1
function foo (bar) if bar == 0 then foobar = 1 end end

@Danny: no problemo :)

@HabitatSoftware: looks promising. will take a look. thanks!

-finefin

EDIT: OH YEAH! IntelliJ IDEA is a nice one!
by copy/pasting chunks of code, my functions become nicely indented. it doesn't split up my one-line-code, but at least it indents beautifully. thanks again!

views:2550 update:2012/2/13 9:11:28
corona forums © 2003-2011