]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/parser.yy: get rid off < > in markups by treating { } as
authorNicolas Sceaux <nicolas.sceaux@free.fr>
Sun, 28 Nov 2004 17:50:32 +0000 (17:50 +0000)
committerNicolas Sceaux <nicolas.sceaux@free.fr>
Sun, 28 Nov 2004 17:50:32 +0000 (17:50 +0000)
real lists.

* lily/lexer.ll: remove < > from markup lexer mode.

* scm/new-markup.scm (map-markup-command-list): helper function
used in parser.yy to map markup commands on a markup list.

* scripts/convert-ly.py (conv): add rule for converting
\markup < > to \markup { }

* ly/titling-init.ly:
* input/test/coriolan-margin.ly:
* input/regression/new-markup-syntax.ly:
* input/regression/new-markup-scheme.ly:
* input/regression/multi-measure-rest-text.ly:
* input/regression/markup-stack.ly:
* input/regression/markup-score.ly:
* input/regression/instrument-name-markup.ly:
* input/mutopia/W.A.Mozart/mozart-hrn-3.ly:
* input/mutopia/R.Schumann/romanze-op28-2.ly:
* input/mutopia/J.S.Bach/wtk1-fugue2.ly:
* input/wilhelmus.ly:
* Documentation/user/notation.itely:
* Documentation/user/music-glossary.tely:
* Documentation/user/changing-defaults.itely: change < > to { } in
markups

22 files changed:
ChangeLog
Documentation/topdocs/NEWS.texi
Documentation/user/changing-defaults.itely
Documentation/user/music-glossary.tely
Documentation/user/notation.itely
input/mutopia/J.S.Bach/wtk1-fugue2.ly
input/mutopia/R.Schumann/romanze-op28-2.ly
input/mutopia/W.A.Mozart/mozart-hrn-3.ly
input/regression/instrument-name-markup.ly
input/regression/markup-score.ly
input/regression/markup-stack.ly
input/regression/multi-measure-rest-text.ly
input/regression/new-markup-scheme.ly
input/regression/new-markup-syntax.ly
input/test/coriolan-margin.ly
input/test/title-markup.ly
input/wilhelmus.ly
lily/lexer.ll
lily/parser.yy
ly/titling-init.ly
scm/new-markup.scm
scripts/convert-ly.py

index f7b206304a6541fab8dddf8843a16a7bbe572322..6b14efbfcc0a6bdb3c312827367c84c319dcd02b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2004-11-28  Nicolas Sceaux  <nicolas.sceaux@free.fr>
+
+       * scm/new-markup.scm (map-markup-command-list): helper function
+       used in parser.yy to map markup commands on a markup list.
+
+       * lily/parser.yy: get rid off < > in markups by treating { } as
+       real lists.
+
+       * lily/lexer.ll: remove < > from markup lexer mode.
+
+       * scripts/convert-ly.py (conv): add rule for converting 
+       \markup < > to \markup { }
+
+       * ly/titling-init.ly: 
+       * input/test/coriolan-margin.ly: 
+       * input/regression/new-markup-syntax.ly: 
+       * input/regression/new-markup-scheme.ly: 
+       * input/regression/multi-measure-rest-text.ly: 
+       * input/regression/markup-stack.ly: 
+       * input/regression/markup-score.ly: 
+       * input/regression/instrument-name-markup.ly: 
+       * input/mutopia/W.A.Mozart/mozart-hrn-3.ly: 
+       * input/mutopia/R.Schumann/romanze-op28-2.ly: 
+       * input/mutopia/J.S.Bach/wtk1-fugue2.ly: 
+       * input/wilhelmus.ly: 
+       * Documentation/user/notation.itely: 
+       * Documentation/user/music-glossary.tely: 
+       * Documentation/user/changing-defaults.itely: change < > to { } in
+       markups
+
 2004-11-28  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * lily/accidental-placement.cc (position_accidentals): shortcut if
index 4f57ab62512ccd7a06fd8b5150e5592f5e21759b..68edfa400a5df90b3c896b6ceba9bedf33741a9e 100644 (file)
@@ -7,6 +7,14 @@
 @unnumbered New features in 2.5 since 2.4
 
 @itemize @bullet
+@item
+In markups, expressions stacked with @code{\column},
+@code{\center-align}, etc, are not grouped with @code{< ... >} anymore,
+but with @code{@{ ... @}}, eg:
+@example
+\markup \column @{ @{ first line @} @{ second line @} @}
+@end example
+
 @item
 LilyPond will now avoid line breaks that cause long texts to stick
 outside of the page staff.
index 11102c2088ba0eb5b21ddff7a59f9e67cf61e2ef..54afeed982877fc1ecd6d9c33cdc8d206454105d 100644 (file)
@@ -1461,14 +1461,14 @@ For clarity, you can also do this for single arguments, e.g.,
 In markup mode you can compose expressions, similar to mathematical
 expressions, XML documents, and music expressions.  The braces group
 notes into horizontal lines.  Other types of lists also exist: you can
-stack expressions grouped with @code{<} and @code{>} vertically with
+stack expressions grouped vertically with
 the command @code{\column}.  Similarly, @code{\center-align} aligns
 texts by their center lines:
 
 @lilypond[quote,verbatim,fragment,relative=1]
-c1^\markup { \column < a bbbb c > }
-c1^\markup { \center-align < a bbbb c > }
-c1^\markup { \line < a b c > }
+c1^\markup { \column { a bbbb c } }
+c1^\markup { \center-align { a bbbb c } }
+c1^\markup { \line { a b c } }
 @end lilypond
 
 
index 0cd3ccea89bb93b784c047503b1b0e675a98f221..51e371af4f932ac7a5807e2f28c883b88cda9891 100644 (file)
@@ -1145,7 +1145,7 @@ another place frequently near the beginning marked by a sign:
   d1 |
   g,4^\segno a b c |
   b a g2_\markup{
-    \line < "d.s. " \tiny \raise #1 \musicglyph #"scripts-segno" > }
+    \line { "d.s. " \tiny \raise #1 \musicglyph #"scripts-segno" } }
   \bar "|."
 }
 @end lilypond
index 9434abfebf6b94d83564b4c42bf191188a7b545f..cfe02440596cb014c6f9d4e54b19c0f90cf63d29 100644 (file)
@@ -5175,8 +5175,8 @@ names, for example
 
 @lilypond[quote,fragment,verbatim,raggedright]
 \set Staff.instrument = \markup {
-  \column < "Clarinetti"
-            { "in B" \smaller \flat } > }
+  \column { "Clarinetti"
+            { "in B" \smaller \flat } } }
 c''1
 @end lilypond
 
@@ -5944,24 +5944,24 @@ select ancient accidentals.   Supported styles are
 {
   \fatText
   s^\markup {
-    \column <
+    \column {
       "vaticana"
       { " " \musicglyph #"accidentals-vaticana-1"
       " " \musicglyph #"accidentals-vaticana0" }
-    >
-    \column <
+    }
+    \column {
       "medicaea"
       { " " \musicglyph #"accidentals-medicaea-1" }
-    >
-    \column <
+    }
+    \column {
       "hufnagel"
       { " " \musicglyph #"accidentals-hufnagel-1" }
-    >
-    \column <
+    }
+    \column {
       "mensural"
       { " " \musicglyph #"accidentals-mensural-1"
       " " \musicglyph #"accidentals-mensural1" }
-    >
+    }
   }
 }
 \layout {
@@ -6458,22 +6458,22 @@ supported are @code{vaticana}, @code{medicaea}, @code{hufnagel}, and
 
 @lilypond[quote,raggedright,fragment]
 \new Lyrics \lyricmode {
-  \markup { \column <
+  \markup { \column {
     \typewriter "vaticana"
     { " " \musicglyph #"custodes-vaticana-u0" }
-  > }
-  \markup { \column <
+  } }
+  \markup { \column {
     \typewriter "medicaea"
     { " " \musicglyph #"custodes-medicaea-u0" }
-  >}
-  \markup { \column <
+  }}
+  \markup { \column {
     \typewriter "hufnagel"
     { " " \musicglyph #"custodes-hufnagel-u0" }
-  >}
-  \markup { \column <
+  }}
+  \markup { \column {
     \typewriter "mensural"
     { " " \musicglyph #"custodes-mensural-u0" }
-  >}
+  }}
 }
 @end lilypond
 
@@ -7756,9 +7756,9 @@ created with a markup text.  This markup text is inserted in the
 % create 2/4 + 5/8
 tsMarkup =\markup {
   \number {
-    \column < "2" "4" >
+    \column { "2" "4" }
     \musicglyph #"scripts-stopped"
-    \bracket \column < "5" "8" >
+    \bracket \column { "5" "8" }
   }
 }
 
index a758949987282bc94634102ae849f17353832b6c..990a0fda1ddd8e41d17caf02885c70f28accf1b4 100644 (file)
     footer = "Mutopia-2002/08/19-6"
 
     tagline = \markup { \smaller
-                       \column <
-                           \fill-line < \footer "" >
-                           \fill-line < { "This music is part of the Mutopia project, "
+                       \column {
+                           \fill-line { \footer "" }
+                           \fill-line { { "This music is part of the Mutopia project, "
                                           \typewriter { "http://sca.uwaterloo.ca/Mutopia/" }
-                                          "." } >
-                           \fill-line < { "It has been typeset and placed in the public "
-                                          "domain by "  \maintainer  "." } >
-                           \fill-line < { "Unrestricted modification and redistribution "
+                                          "." } }
+                           \fill-line { { "It has been typeset and placed in the public "
+                                          "domain by "  \maintainer  "." } }
+                           \fill-line { { "Unrestricted modification and redistribution "
                                           "is permitted and encouraged---copy this music "
-                                          "and share it!" } >
-                       >
+                                          "and share it!" } }
+                       }
                    }
     lastupdated = "2002/August/19"
 }
@@ -44,7 +44,7 @@ to match up.
 %}
 
 
-\version "2.4.0"
+\version "2.5.2"
 
 
 
index 2a0430f82663243da9014ea6808cca01cdbf3270..5fd784b3d31714365c06733533b267f42f1c50b3 100644 (file)
@@ -5,7 +5,7 @@
 
 #(set-global-staff-size 16)
 
-\version "2.4.0"
+\version "2.5.2"
 
 \header {
   title = "Romanzen"
@@ -259,7 +259,7 @@ leftb =  \transpose c cis {
     \override Staff.InstrumentName #'font-magnification = #1
     \override Staff.InstrumentName #'extra-offset = #'(0 . 6)
    % \set Staff.instrument = "\\begin{turn}{-90}{Rechte Hand}\\end{turn}"
-    \set Staff.instrument = \markup { \column < Rechte Hand >  \hspace #2 }
+    \set Staff.instrument = \markup { \column { Rechte Hand }  \hspace #2 }
       \clef F <<\global \context Voice = "midv" \rightb>>
     }
       \context Staff = "down" {
index bbb95c951c3103a36ea37d927e7f6fc90076c224..2ba9a4563c172c6bae5e9d1b939428b930a45515 100644 (file)
   footer = "Mutopia-2002/05/21-25"
 
   tagline = \markup { \smaller
-      \column <
-          \fill-line < \footer "" >
-          \fill-line < { "This music is part of the Mutopia project,"
+      \column {
+          \fill-line { \footer "" }
+          \fill-line { { "This music is part of the Mutopia project,"
                          \typewriter { "http://sca.uwaterloo.ca/Mutopia/" }
-                        } >
-          \fill-line < #(ly:export (string-append "It has been typeset and placed in the public "
-                         "domain by "  maintainer  "."))  >
-          \fill-line < #(ly:export (string-append "Unrestricted modification and redistribution"
+                        } }
+          \fill-line { #(ly:export (string-append "It has been typeset and placed in the public "
+                         "domain by "  maintainer  "."))  }
+          \fill-line { #(ly:export (string-append "Unrestricted modification and redistribution"
                          " is permitted and encouraged---copy this music"
-                         " and share it!")) >
-          >
+                         " and share it!")) }
+          }
        }
 }
 %{
@@ -41,7 +41,7 @@ virtuoso that taught in Geneva.
 
 %}
 
-\version "2.4.0"
+\version "2.5.2"
 
 \include "mozart-hrn3-defs.ily"
 \include "mozart-hrn3-allegro.ily"
index 747b5aa7f8759245945c692dd76575fc41176f58..e32678dd63177385bf7cdb341063f19c4625681a 100644 (file)
@@ -7,14 +7,14 @@ including alterations. "
 }
 
 
-\version "2.4.0"
+\version "2.5.2"
 
 
 textFlat = \markup {\smaller \flat}
 
 \score {
    \new Staff {
-    \set Staff.instrument = \markup { \column < "Clarinetti" { "in B" \textFlat } > }
+    \set Staff.instrument = \markup { \column { "Clarinetti" { "in B" \textFlat } } }
     \set Staff.instr = \markup { \smaller  { "Cl(B" \textFlat ")" } }
 
     { c''1 \break c'' }
index 29694cd53056800707c42b249646cc4b99a2ff3f..971c30850e0d1a7984ffd515b7587ac4ddcc9a9b 100644 (file)
@@ -2,7 +2,7 @@
     texidoc = "Use \\score block as markup command."
 }
 
-\version "2.4.0"
+\version "2.5.2"
 
 tuning = \markup {
     \score {
@@ -19,7 +19,7 @@ tuning = \markup {
 \header {
     title = "Solo Cello Suites"
     subtitle = "Suite IV"
-    subsubtitle = \markup { \fill-line < { "Originalstimmung: " \tuning } > }
+    subsubtitle = \markup { \fill-line { { "Originalstimmung: " \tuning } } }
 }
 
 \relative {
index 158e025cbe72d30f044e9ae18f4c7436b7a0ef44..92668fbdef65f76b6ecd8e486be1007024063805 100644 (file)
@@ -1,6 +1,6 @@
-\version "2.4.0"
+\version "2.5.2"
 \header {texidoc="Markup scripts may be stacked."}
 \layout { raggedright = ##t}
-\score {  { c''^\markup { "a" \column < "1" \bold "2"  "3" > } } }
+\score {  { c''^\markup { "a" \column { "1" \bold "2"  "3" } } } }
 
 
index 8d4329b9eb6648e196e035b9b3a089ee5ac930bc..b1e8294a552bb7d2c71ff4bd0f56423872513d14 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.4.0"
+\version "2.5.2"
 
 \header  {
 
@@ -13,7 +13,7 @@ Texts may be added to the multi-measure rests.
 \score {  {
   \time 3/4
   \set Score.skipBars = ##t
-  R2._\markup { \center-align < \musicglyph  #"scripts-dfermata" \roman "Ad lib"  >  }
+  R2._\markup { \center-align { \musicglyph  #"scripts-dfermata" \roman "Ad lib"  }  }
   R2.^\fermataMarkup
   R2.^"4"
   R2.*3_\markup { \roman "a1b2c3" }
index 80bb978e901bb17db4e9007a8d862346da0ca0bb..7f7aa3166fbbc6577236b8b5b1bd1d1eb5b02068 100644 (file)
@@ -5,7 +5,7 @@
     texts using a similar syntax as @code{\\markup}."
 
     }
-\version "2.4.0"
+\version "2.5.2"
 \score {
      {
         \fatText
@@ -14,7 +14,7 @@
             \raise #0.2 \hbracket \bold bar
             \override #'(baseline-skip . 4)
 
-            \bracket \column < baz bazr bla >
+            \bracket \column { baz bazr bla }
             \hspace #2.0
             \override #'(font-family . music) {
                 \lookup #"noteheads-0"
@@ -23,7 +23,7 @@
             \musicglyph #"accidentals--1"
             \combine "X" "+"   
             \combine "o" "/"
-            \box \column < { "string 1" } { "string 2" } >
+            \box \column { { "string 1" } { "string 2" } }
             "$\\emptyset$"
             \italic Norsk
             \super "2"
index c9bdb22b01246326ade12a09f1ab40b71dbdce54..94c82ce1220fb9f266abd467742bb3189b304b88 100644 (file)
@@ -2,7 +2,7 @@
 texidoc = "With the new markup syntax, text may be written in various manners."
 }
 
-\version "2.4.0"
+\version "2.5.2"
 
 
 \score {
@@ -13,7 +13,7 @@ texidoc = "With the new markup syntax, text may be written in various manners."
                \raise #0.2 \hbracket \bold bar
                \override #'(baseline-skip . 4)
 
-               \bracket \column < baz bazr bla >
+               \bracket \column { baz bazr bla }
                \hspace #2.0
                \override #'(font-family . music) {
                        \lookup #"noteheads-0"
@@ -26,7 +26,7 @@ texidoc = "With the new markup syntax, text may be written in various manners."
                \combine "X" "+"   
                \combine "o" "/"
 %              \char-number #"abc1234abc"
-               \box \column < { "string 1" } { "string 2" } >
+               \box \column { { "string 1" } { "string 2" } }
                "$\\emptyset$"
                \italic Norsk
                \super "2"
index 0f9a9c58bcc94618506d1505a12e8f224330ce00..a23da9e4325ac778f422d07014dc61e20cbba0ac 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.4.0"
+\version "2.5.2"
 
 
 % Ugh, we need to override some LaTeX titling stuff
@@ -42,7 +42,7 @@ oboi =  \relative c' {
 }
 
 clarinetti =  \relative c' {
-    \set Staff.instrument = \markup { \column < "Clarinetti" { "in B" \raisedFlat } > }
+    \set Staff.instrument = \markup { \column { "Clarinetti" { "in B" \raisedFlat } } }
     \set Staff.instr = \markup { \smaller  { "Cl(B" \raisedFlat ")" } }
 
   c1 c
@@ -55,21 +55,21 @@ fagotti =  \relative c' {
 }
 
 corni =  \relative c' {
-    \set Staff.instrument = \markup { \column < "Corni" { "in E" \raisedFlat } > }
+    \set Staff.instrument = \markup { \column { "Corni" { "in E" \raisedFlat } } }
     \set Staff.instr = \markup { \smaller  { "Cor(E" \raisedFlat ")" } }
 
   c1 c
 }
 
 trombe =  \relative c' {
-  \set Staff.instrument = \markup \column < "2 Trombe" "(C)" >
-  \set Staff.instr = \markup \column <  "Tbe." "(C)" >
+  \set Staff.instrument = \markup \column { "2 Trombe" "(C)" }
+  \set Staff.instr = \markup \column {  "Tbe." "(C)" }
 
   c1 c
 }
 
 timpani =  \relative c' {
-  \set Staff.instrument = \markup \column < "Timpani" "(C-G)" >
+  \set Staff.instrument = \markup \column { "Timpani" "(C-G)" }
   \set Staff.instr = #"Timp."
 
   c1 c
@@ -95,8 +95,8 @@ viola =  \relative c' {
 }
 
 violoncello =  \relative c' {
-  \set Staff.instrument = \markup \column < "Violoncello" "e" "Contrabasso" >
-  \set Staff.instr = \markup \column <  "Vc." "Cb." >
+  \set Staff.instrument = \markup \column { "Violoncello" "e" "Contrabasso" }
+  \set Staff.instr = \markup \column {  "Vc." "Cb." }
   c1 c
 }
 
index 7feac6326e975b50e662f150290444413c054e63..0be842162e4a745bb63b7128872e757547f0f732 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.4.0"
+\version "2.5.2"
 
 %{
    Markup titles also available for direct PostScript output:
@@ -37,7 +37,7 @@ latinTest = \markup {
 }
     
 sizeTest = \markup {
-       \column <
+       \column {
             { \normalsize "normalsize"
               \hspace #5
               \smaller "smaller"
@@ -55,7 +55,7 @@ sizeTest = \markup {
               \hspace #5
               \bigger \bigger \bigger "bigger"
             }
-       >
+       }
 }
 
 \encoding "latin1"
@@ -85,7 +85,7 @@ spaceTest = \markup { "two space chars" }
     piece = "Piece"
 
     %% Override automatic book title
-    %% bookTitle = \markup { \fill-line < \huge\bold \title > > }
+    %% bookTitle = \markup { \fill-line { \huge\bold \title } }
 }
 
 \book {
index 0cc4134901421f03fa010b7dba3e531dc55e6be1..b1eaadaa6a5ab7025f5768e91184384c14c8eeed 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.4.0"
+\version "2.5.2"
 
 \header {
   texidoc = "Wilhelmus van Nassouwe"
@@ -142,7 +142,7 @@ text = \lyricmode {
 
 oneHalfNoteTime = \markup {
   \override #'(baseline-skip . 0)
-  \column < { \number "1" } { \smaller \smaller \note #"2" #-0.5 } >
+  \column { { \number "1" } { \smaller \smaller \note #"2" #-0.5 } }
 }
 
 \layout {
index 98d77c065009e1eb1120b909cdd48e4ff1a7d5a5..b0d9d9f051b5323826665fc60071a5b3b60243eb 100644 (file)
@@ -485,12 +485,6 @@ HYPHEN             --
        \" {
                start_quote ();
        }
-       \< {
-               return '<';
-       }
-       \> {
-               return '>';
-       }
        \\score {
                return SCORE;
        }
@@ -530,7 +524,7 @@ HYPHEN              --
        [{}]    {
                return YYText ()[0];
        }
-       [^<>#{}"\\ \t\n\r\f]+ {
+       [^#{}"\\ \t\n\r\f]+ {
                String s (YYText ()); 
 
                char c = s[s.length () - 1];
index 7743e1bdc6e1bb3266c599750d0a99edd3e11cf3..43670458d2352ca6bae52b3aa5e07dae4706b263 100644 (file)
@@ -444,7 +444,7 @@ or
 %type <scm>    Generic_prefix_music_scm 
 %type <scm>    lyric_element
 %type <scm>     Alternative_music
-%type <scm>    markup markup_line markup_list markup_list_body full_markup
+%type <scm>    full_markup markup_composed_list markup_braced_list markup_braced_list_body markup_head_1_item markup_head_1_list markup simple_markup markup_top
 %type <scm>    mode_changing_head
 %type <scm>    mode_changing_head_with_context
 %type <scm>     object_id_setting 
@@ -2463,58 +2463,85 @@ questions:
        | questions '?' { $$ ++; }
        ;
 
-
+/*
+This should be done more dynamically if possible.
+*/
 
 full_markup:
        MARKUP_IDENTIFIER {
                $$ = $1;
-       }
+       }
        | MARKUP
                { THIS->lexer_->push_markup_state (); }
-       markup
-               $$ = $3;
-                 THIS->lexer_->pop_state ();
-               }
+       markup_top {
+               $$ = $3;
+               THIS->lexer_->pop_state ();
+       }
        ;
 
-
-/*
-This should be done more dynamically if possible.
-*/
-markup:
-       STRING {
-               $$ = make_simple_markup (THIS->lexer_->encoding (), $1);
+markup_top:
+       markup_composed_list { 
+               $$ = scm_list_2 (ly_scheme_function ("line-markup"),  $1); 
        }
-       | MARKUP_HEAD_EMPTY {
-               $$ = scm_list_1 ($1);
+       | markup_head_1_list simple_markup      {
+               $$ = scm_car (scm_call_2 (ly_scheme_function ("map-markup-command-list"), $1, scm_list_1 ($2)));
        }
-       | MARKUP_HEAD_MARKUP0 markup {
-               $$ = scm_list_2 ($1, $2);
+       | simple_markup {
+               $$ = $1;
        }
-       | MARKUP_HEAD_MARKUP0_MARKUP1 markup markup {
-               $$ = scm_list_3 ($1, $2, $3);
+       | markup_braced_list    {
+               $$ = scm_list_2 (ly_scheme_function ("line-markup"), $1);
        }
-       | MARKUP_HEAD_SCM0_MARKUP1 SCM_T markup {
-               $$ = scm_list_3 ($1, $2, $3);
+       ;
+
+markup_composed_list:
+       markup_head_1_list markup_braced_list {
+               $$ = scm_call_2 (ly_scheme_function ("map-markup-command-list"), $1, $2);
+               
        }
-       | markup_line {
-               $$ = $1;
+       ;
+
+markup_braced_list:
+       '{' markup_braced_list_body '}' {
+               $$ = scm_reverse_x ($2, SCM_EOL);
        }
-       | MARKUP_HEAD_LIST0 markup_list {
-               $$ = scm_list_2 ($1,$2);
+       ;
+
+markup_braced_list_body:
+       /* empty */     {  $$ = scm_list (SCM_EOL); }
+       | markup_braced_list_body markup {
+               $$ = scm_cons ($2, $1);
        }
-       | MARKUP_HEAD_SCM0 embedded_scm {
-               $$ = scm_list_2 ($1, $2);
+       | markup_braced_list_body markup_composed_list {
+               $$ = scm_append_x (scm_list_2 (scm_reverse_x ($2, SCM_EOL), $1));
        }
-       | MARKUP_HEAD_SCM0_SCM1_MARKUP2 embedded_scm embedded_scm markup {
-               $$ = scm_list_4 ($1, $2, $3, $4);
+       ;
+
+markup_head_1_item:
+       MARKUP_HEAD_MARKUP0     {
+               $$ = scm_list_1 ($1);
        }
-       | MARKUP_HEAD_SCM0_SCM1_SCM2 embedded_scm embedded_scm embedded_scm {
-               $$ = scm_list_4 ($1, $2, $3, $4);
+       | MARKUP_HEAD_SCM0_MARKUP1 embedded_scm {
+               $$ = scm_list_2 ($1, $2);
        }
-       | MARKUP_HEAD_SCM0_SCM1 embedded_scm embedded_scm {
+       | MARKUP_HEAD_SCM0_SCM1_MARKUP2 embedded_scm embedded_scm       {
                $$ = scm_list_3 ($1, $2, $3);
        }
+       ;
+
+markup_head_1_list:
+       markup_head_1_item      {
+               $$ = scm_list_1 ($1);
+       }
+       | markup_head_1_list markup_head_1_item {
+               $$ = scm_cons ($2, $1);
+       }
+       ;
+
+simple_markup:
+       STRING {
+               $$ = make_simple_markup (THIS->lexer_->encoding (), $1);
+       }
        | MARKUP_IDENTIFIER {
                $$ = $1;
        }
@@ -2530,28 +2557,38 @@ markup:
                scm_gc_unprotect_object (sc->self_scm ());
                THIS->lexer_->pop_state ();
        }
+       | MARKUP_HEAD_SCM0 embedded_scm {
+               $$ = scm_list_2 ($1, $2);
+       }
+       | MARKUP_HEAD_SCM0_SCM1_SCM2 embedded_scm embedded_scm embedded_scm {
+               $$ = scm_list_4 ($1, $2, $3, $4);
+       }
+       | MARKUP_HEAD_SCM0_SCM1 embedded_scm embedded_scm {
+               $$ = scm_list_3 ($1, $2, $3);
+       }
+       | MARKUP_HEAD_EMPTY {
+               $$ = scm_list_1 ($1);
+       }
+       | MARKUP_HEAD_LIST0 markup_braced_list {
+               $$ = scm_list_2 ($1,$2);
+       }
+       | MARKUP_HEAD_MARKUP0_MARKUP1 markup markup {
+               $$ = scm_list_3 ($1, $2, $3);
+       }
        ;
-
-markup_list:
-       chord_open markup_list_body chord_close { $$ = scm_reverse_x ($2, SCM_EOL); }
-       ;
-
-markup_line:
-       '{' markup_list_body '}' {
-               SCM line = ly_scheme_function ("line-markup");
        
-               $$ = scm_list_2 (line, scm_reverse_x ($2, SCM_EOL));
+markup:
+       markup_head_1_list simple_markup        {
+               $$ = scm_car (scm_call_2 (ly_scheme_function ("map-markup-command-list"), $1, scm_list_1 ($2)));
        }
-       ;
-
-markup_list_body:
-       /**/ {  $$ = SCM_EOL; }
-       | markup_list_body markup {
-               $$ = scm_cons ($2, $1);
+       | simple_markup {
+               $$ = $1;
+       }
+       | markup_braced_list {
+               $$ = scm_list_2 (ly_scheme_function ("line-markup"), $1);
        }
        ;
 
-
 %%
 
 void
index bea90f7ebcc5166fdeb3ef8f50a54b69f668683b..47f6e390a799fbff59842827d4d158757d28f634 100644 (file)
@@ -1,58 +1,58 @@
 bookTitleMarkup = \markup {
-  \column <
-    \fill-line < \fromproperty #'header:dedication >
-    \fill-line <
+  \column {
+    \fill-line { \fromproperty #'header:dedication }
+    \fill-line {
       \huge \bigger \bigger \bigger \bold \fromproperty #'header:title
-    >
-    \fill-line <
+    }
+    \fill-line {
       \override #'(baseline-skip . 3)
-      \column <
-       \fill-line <
+      \column {
+       \fill-line {
          \huge \bigger \bigger
          \bold \fromproperty #'header:subtitle
-       >
-       \fill-line <
+       }
+       \fill-line {
          \huge \bigger
          \bold \fromproperty #'header:subsubtitle
-       >
-      >
-    >
-    \fill-line <
+       }
+      }
+    }
+    \fill-line {
       \fromproperty #'header:poet
       \fromproperty #'header:instrument 
-      \column <
+      \column {
        \fromproperty #'header:composer
        \fromproperty #'header:arranger
-      >
-    >
-  >
+      }
+    }
+  }
 }
 
 scoreTitleMarkup = \markup {
-  \fill-line <
+  \fill-line {
     \fromproperty #'header:piece
     \fromproperty #'header:opus
-  >
+  }
 }
 
 
 oddHeaderMarkup = \markup
-\fill-line <
+\fill-line {
   ""
   \fromproperty #'header:instrument
   \fromproperty #'page:page-number-string
->
+}
 
 evenHeaderMarkup = \markup
-\fill-line <
+\fill-line {
   \fromproperty #'page:page-number-string
   \fromproperty #'header:instrument
   ""
->
+}
 
 oddFooterMarkup = \markup {
-  \column <
-    \fill-line <
+  \column {
+    \fill-line {
 
       % put copyright only on pagenr. 1 
       \on-the-fly #(lambda (layout props arg)
@@ -61,8 +61,8 @@ oddFooterMarkup = \markup {
                     empty-stencil
                   ))
       \fromproperty #'header:copyright
-    >
-    \fill-line <
+    }
+    \fill-line {
       % put tagline only on last page
       \on-the-fly #(lambda (layout props arg)
                    (if (chain-assoc-get 'page:last?  props #f)
@@ -70,7 +70,7 @@ oddFooterMarkup = \markup {
                     empty-stencil
                   ))
       \fromproperty #'header:tagline
-    >
-  >
+    }
+  }
 }
 
index d9cabccea2fc830c2223de59f835acc5c538a4cc..5397514793d6b7ce48ab132454ceffec6ba89294 100644 (file)
@@ -331,6 +331,24 @@ Also set markup-signature and markup-keyword object properties."
   (let ((proc (markup-symbol-to-proc (string->symbol (string-append code "-markup")))))
     (and proc (cons proc (markup-command-keyword proc)))))
 
+;;;;;;;;;;;;;;;;;;;;;;
+;;; used in parser.yy to map a list of markup commands on markup arguments
+(define-public (map-markup-command-list commands markups)
+  "`markups' being a list of markups, eg (markup1 markup2 markup3),
+and `commands' a list of commands with their scheme arguments, in reverse order,
+eg: ((italic) (raise 4) (bold)), maps the commands on each markup argument, eg:
+ ((bold (raise 4 (italic markup1)))
+  (bold (raise 4 (italic markup2)))
+  (bold (raise 4 (italic markup3))))
+"
+  (map-in-order (lambda (arg)
+                  (let ((result arg))
+                    (for-each (lambda (cmd)
+                                (set! result (append cmd (list result))))
+                              commands)
+                    result))
+                markups))
+
 ;;;;;;;;;;;;;;;;;;;;;;
 ;;; markup type predicates
 
index 27704d492a8514bc91eb4aab616fc70d497e552c..2e973151e6f5269628ded1e77e9263681a96309d 100644 (file)
@@ -2280,7 +2280,18 @@ conversions.append (((2, 5, 1),
                     conv,
                     'ly:import-module -> ly:module-copy'))
 
+def conv (str):
+       str = re.sub (r'\\(column|fill-line|dir-column|center-align|right-align|left-align|bracketed-y-column)\s*<([^<]*)>',
+                     r'\\\1 {\2}', str)
+       str = re.sub (r'\\(column|fill-line|dir-column|center-align|right-align|left-align|bracketed-y-column)\s*<([^<]*)>',
+                     r'\\\1 {\2}', str)
+       str = re.sub (r'\\(column|fill-line|dir-column|center-align|right-align|left-align|bracketed-y-column)\s*<([^<]*)>',
+                     r'\\\1 {\2}', str)
+       return str
 
+conversions.append (((2, 5, 2),
+                    conv,
+                    '\markup .. < .. > .. -> \markup .. { .. } ..'))
 
 ################################
 #      END OF CONVERSIONS