lilypond-devel
[Top][All Lists]
Advanced

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

Extending #{ ... #}


From: David Kastrup
Subject: Extending #{ ... #}
Date: Fri, 29 Jul 2011 15:52:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Hi,

currently the following works because it hacks around a number of
internals in parser-ly-from-scheme.scm:

zap = #(define-music-function (parser location str) (string?)
                               #{ }
                               parseStringResult = ^\markup { $str }
                               { #})
\new Voice { \zap #"pling" r4 c_\zap #"plong" }

This is not pretty.  I'd like to get there using just
#{ ^\markup { $str } #}

And I would want #{ ... #} to work for other entities valid in
assignments, without losing its current way of dealing with simple
sequential music.

The idea would be to have read-lily-expression push a special start
symbol into the parser that would throw it into a mode suitable for
parsing a #{ #} spec (which is better delimited than the argument for an
assignment).

How to get that start symbol in?  Optional argument for the parser?
Explicit call pushing the token?

Suggestions?

-- 
David Kastrup




reply via email to

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