"Bertalan Fodor (LilyPondTool)" <lilypondt...@organum.hu> 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



_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to