bug-lilypond
[Top][All Lists]
Advanced

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

Re: Issue 1516 in lilypond: Crash with empty \markuplines


From: lilypond
Subject: Re: Issue 1516 in lilypond: Crash with empty \markuplines
Date: Mon, 14 Feb 2011 23:16:32 +0000


Comment #1 on issue 1516 by address@hidden: Crash with empty \markuplines
http://code.google.com/p/lilypond/issues/detail?id=1516

\markuplines { } returns '(), which is valid according to markup-list? (and its C++
equivalent, Text_interface::is_markup_list ()):

foo = \markuplines { }

#(display (markup-list? foo))

-> #t

Assuming we want \markuplines { } to behave like \markup { } (i.e., produce a \null toplevel markup), then this patch works, since it ensures a valid Paper_score in paper-book.cc:

diff --git a/lily/parser.yy b/lily/parser.yy
index 0bb4c15..e6a7e09 100644
--- a/lily/parser.yy
+++ b/lily/parser.yy
@@ -2405,7 +2405,10 @@ full_markup_list:
        | MARKUPLINES
                { PARSER->lexer_->push_markup_state (); }
        markup_list {
-               $$ = $3;
+               if (scm_is_pair ($3))
+                       $$ = $3;
+               else
+ $$ = scm_list_1 (scm_cons (ly_lily_module_constant ("null-markup"), SCM_EOL));
                PARSER->lexer_->pop_state ();
        }
        ;

It's perhaps not the most elegant solution, so if anybody can come up with something better which doesn't cause any shift/reduce or reduce/reduce problems I'd be interested to see it. :)




reply via email to

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