lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



Le 24 mai 08 à 05:53, David Manura a écrit :
James Porter writes:
KHMan wrote:
Bertrand Mansion wrote:
Is there a lua snippet that can "beautify" lua source code, especially
indentation?
This one <http://lua-users.org/wiki/SciteIndentation> doesn't work well, it's missing a lot of things code snippets within multiline comments for
example.

Another simple one: http://lua-users.org/wiki/SourceCodeFormatter .

This one only cleans indent if they are already present in the code.

There are
also various Lua lexers and parsers one can base something like this on:
http://lua-users.org/wiki/LuaGrammar .

Cheese might be interesting then <http://luaforge.net/projects/cheese/ > if I manage to understand how it works... :)

I agree that reformatting comment
contents (lacking any standard grammar for them) is not a well- defined problem.

Actually, I don't think it is a good idea to try to format/indent what is in comments. That's what <http://lua-users.org/wiki/ SciteIndentation> is doing because it doesn't care about comments.


--
Bertrand Mansion
Mamasam
Work : http://www.mamasam.com
Blog : http://golgote.freeflux.net