[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: indent-ly
From: |
Wilbert Berendsen |
Subject: |
Re: indent-ly |
Date: |
Mon, 26 Oct 2009 13:44:36 +0100 |
User-agent: |
KMail/1.12.2 (Linux/2.6.31-14-generic; KDE/4.3.2; i686; ; ) |
Op donderdag 22 oktober 2009 schreef Bertalan:
> Now, the real problem I see with this approach is that no perfect
> formatting (which is not the same as indentation) can be done without
> actually parsing the input.
I think this is true; my indent script[1] includes a basic parser. It knows
when to switch from LilyPond to Scheme mode and back again and also supports
LilyPond code in Scheme.
It also has a nice feature that line-comments starting with three %%% or ;;;
are not indented, because that comment style if often used to mark big
sections of LilyPond or Scheme input.
The scheme indenting currently works like this: If an opening parenthesis is
found, the following 10 characters are searched for another one (before
closing one or newline). If there is another opening parenthesis on the same
line, the next line is aligned the same way. If none is found, the normal
indent is used. (default 2).
[1]
http://code.google.com/p/lilykde/source/browse/trunk/frescobaldi/python/ly/indent.py
best regards,
Wilbert Berendsen
--
Frescobaldi, LilyPond editor for KDE: http://www.frescobaldi.org/
Nederlands LilyPond forum: http://www.lilypondforum.nl/
- Re: indent-ly, (continued)
- Re: indent-ly, -Eluze, 2009/10/21
- Re: indent-ly, Graham Percival, 2009/10/21
- Re: indent-ly, Bertalan Fodor (LilyPondTool), 2009/10/22
- Re: indent-ly, David Kastrup, 2009/10/22
- Re: indent-ly, Bertalan Fodor (LilyPondTool), 2009/10/22
- Re: indent-ly, Martin Tarenskeen, 2009/10/23
- Re: indent-ly,
Wilbert Berendsen <=
Message not available
- Message not available
- Message not available
- Message not available
- Re: indent-ly, Martin Tarenskeen, 2009/10/23
- Re: indent-ly, Daniel Hulme, 2009/10/23