]> git.donarmstrong.com Git - lilypond.git/commitdiff
Allow \markuplines to be stored in a variable and inserted later on in the parser
authorReinhold Kainhofer <reinhold@kainhofer.com>
Tue, 4 Jan 2011 14:14:10 +0000 (15:14 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Wed, 26 Jan 2011 10:55:03 +0000 (11:55 +0100)
input/regression/markup-lines-identifier.ly [new file with mode: 0644]
lily/parser.yy

diff --git a/input/regression/markup-lines-identifier.ly b/input/regression/markup-lines-identifier.ly
new file mode 100644 (file)
index 0000000..65a40f3
--- /dev/null
@@ -0,0 +1,19 @@
+\version "2.13.47"
+
+\header {
+  texidoc = "Text that can spread over pages is entered with the
+@code{\\markuplines} command. It can be assigned to a variable and inserted
+at top-level with or without preceding it by @code{\\markuplines}."
+}
+
+#(set-default-paper-size "a6")
+
+mytext = \markuplines {
+  \justified-lines {
+    Lorem ipsum dolor sit amet, consectetur adipisici elit, sed
+    eiusmod tempor incidunt ut labore et dolore magna aliqua. ...
+  }
+}
+
+\markuplines \mytext
+\mytext
index 031e117e9022e7aff87bda04900b30f4f1a0df38..240a4c1e3b2086c29494df7e1b3816729bf7bae5 100644 (file)
@@ -290,6 +290,7 @@ If we give names, Bison complains.
 %token <scm> MARKUP_FUNCTION
 %token <scm> MARKUP_LIST_FUNCTION
 %token <scm> MARKUP_IDENTIFIER
+%token <scm> MARKUPLINES_IDENTIFIER
 %token <scm> MUSIC_FUNCTION
 %token <scm> MUSIC_IDENTIFIER
 %token <scm> NOTENAME_PITCH
@@ -615,6 +616,9 @@ identifier_init:
        | full_markup {
                $$ = $1;
        }
+       | full_markup_list {
+               $$ = $1;
+       }
        | DIGIT {
                $$ = scm_from_int ($1);
        }
@@ -2401,7 +2405,10 @@ lyric_markup:
        ;
 
 full_markup_list:
-       MARKUPLINES
+       MARKUPLINES_IDENTIFIER {
+               $$ = $1;
+       }
+       | MARKUPLINES
                { PARSER->lexer_->push_markup_state (); }
        markup_list {
                $$ = $3;
@@ -2434,7 +2441,10 @@ markup_top:
        ;
 
 markup_list:
-       markup_composed_list {
+       MARKUPLINES_IDENTIFIER {
+               $$ = $1;
+       }
+       | markup_composed_list {
                $$ = $1;
        }
        | markup_braced_list {
@@ -2627,6 +2637,9 @@ Lily_lexer::try_special_identifiers (SCM *destination, SCM sid)
                if (is_lyric_state ())
                        return LYRIC_MARKUP_IDENTIFIER;
                return MARKUP_IDENTIFIER;
+       } else if (Text_interface::is_markup_list (sid)) {
+               *destination = sid;
+               return MARKUPLINES_IDENTIFIER;
        }
 
        return -1;