Comment #1 on issue 1516 by n.putt...@gmail.com: 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. :)
_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond