lilypond-user
[Top][All Lists]
Advanced

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

Re: indent-ly


From: David Kastrup
Subject: Re: indent-ly
Date: Thu, 22 Oct 2009 11:49:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

"Bertalan Fodor (LilyPondTool)" <address@hidden> writes:

> 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 don't see that.

> Complete parsing of LilyPond input is _impossible_ without LilyPond
> itself.

There are very few things actually affecting input syntax (redefining
note names is one of those).  Chord and lyrics mode, too, but I don't
think that the subtleties are actually important for formatting and
indentation.  It is perfectly acceptable to just break on spaces, and
indent according to >> } > nesting.  After discounting quoted strings,
-> \> \< and similar articulation.

> For example you need to format LilyPond code _inside_ Scheme code
> (remember the #{ construct used in define-music-function)

Yes, but it is not like there are multiple arbitrary ways in which this
can happen.  It is actually just #{ IIRC.

> So a standard formatting engine can only be written inside LilyPond,
> or at least using LilyPond to generate metadata describing the
> structure of the input.

I think that view is overly pessimistic.

-- 
David Kastrup





reply via email to

[Prev in Thread] Current Thread [Next in Thread]