[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua indentation
- From: Bertrand Mansion <golgote@...>
- Date: Sat, 24 May 2008 10:26:18 +0200
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