lilypond-devel
[Top][All Lists]
Advanced

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

Re: parser.yy / grammar


From: Knut Petersen
Subject: Re: parser.yy / grammar
Date: Tue, 24 Apr 2018 23:09:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

Am 24.04.2018 um 21:16 schrieb David Kastrup:


\version "2.21.0"

\score{ { c'2     } \addlyrics                      { Hi there }   \layout {}}
\score{ { c'2     } \addlyrics   \displayLilyMusic  { Hi there }   \layout {}}
\score{ { c'2     } \addlyrics { \displayLilyMusic  { Hi there } } \layout {}}
\score{ { c'2 2   } \addlyrics                      { Hi there }   \layout {}}
\score{ { c'2 2   } \addlyrics   \displayLilyMusic  { Hi there }   \layout {}}
\score{ { c'2 2   } \addlyrics { \displayLilyMusic  { Hi there } } \layout {}}
\score{ { c'2 2 2 } \addlyrics                      { Hi there }   \layout {}}
\score{ { c'2 2 2 } \addlyrics   \displayLilyMusic  { Hi there }   \layout {}}
\score{ { c'2 2 2 } \addlyrics { \displayLilyMusic  { Hi there } } \layout {}}
Uh what?  How is the output correct?


One, two, or three notes, lyrics as expected. See attached pdfs.

To make things clear:

 * \displayLilyMusic is  a music function, it never is acceptable to \addlyrics 
in the current version of lilypond
 * { \displayLilyMusic ... }  is always acceptable because it is a 
grouped_music_list (but the current parser does not automatically force lyric 
state)

Some more examples:

Correct syntax for both original and patched versions:

   \score{ { c'2 2 2 } \addlyrics                                { Hi there }   
\layout {}}
   \score{ { c'2 2 2 } \addlyrics {                   \lyricmode { Hi there } } 
\layout {}}
   \score{ { c'2 2 2 } \addlyrics { \displayLilyMusic { Hi there } } \layout {}}
   \score{ { c'2 2 2 } \addlyrics { \displayLilyMusic \lyricmode { Hi there } } 
\layout {}}

Bad syntax for old version (bad output), correct syntax for patched version:

   \score{ { c'2 2 2 } \addlyrics   \displayLilyMusic \lyricmode { Hi there }   
\layout {}}

Bad syntax for both versions (bad output for the original version, good output 
for the patched version):

   \score{ { c'2 2 2 } \addlyrics \displayLilyMusic            { Hi there }   
\layout {}}

Attached is a 2nd version of the patch. With that extended version _all_ 
examples above
 compile without warnings/errors and give the desired result.

Knut

Attachment: ptest.patched.pdf
Description: Adobe PDF document

Attachment: ptest.orig.pdf
Description: Adobe PDF document

Attachment: 0001-lyric_mode_music-allow-music_function_call.patch
Description: Text Data


reply via email to

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