[plug] Code Indenter/formater with continuation

Timothy White weirdo at tigris.org
Tue Nov 16 07:43:41 WST 2004


I am looking for a code indenter to work on some files that aren't a 
well known language so I need a 'generic' code indenter.
It needs to know about block elements (if,then,elseif,endif...) or be 
able to learn. It also needs to know about continuation lines (';' marks 
the end of a statement but not for all block elements[1])  and be able 
to split long lines at a defined element( + ).
Se below for an example[2].
Thanks
Tim
[1] It appears that a 'for' block doesn't require a trailing ';' but a 
'if' block does. This is a very odd language
[2]
--- Input
carrot = red + long + vegetable + good boiled + ...;
For object in list do
If some condition then
some: actions;
and more actions;
and more actions;
elseif another condition
then other actions;
Endif;
Endfor
--- Output (correct as far as I know)
carrot = red + long + vegetable +
	good boiled + ...;
For object in list do
	If some condition then
		some: actions;
		and more actions;
		and more actions;
	elseif another condition
		then other actions;
	Endif;
Endfor
-- 
Tim White - Use the Fox, Luke!
PGP/GPG id: 602E944D, Pub Key Serv: subkeys.pgp.net
Fingerprint: 04C2 9682 B7B2 3006 009D  A9F3 067E EDCD 602E 944D
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me 
spread!
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20041116/3a27cbad/attachment.pgp>


More information about the plug mailing list