lilypond-devel
[Top][All Lists]
Advanced

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

Re: markups: s/<>/{}/


From: Nicolas Sceaux
Subject: Re: markups: s/<>/{}/
Date: Sun, 28 Nov 2004 19:18:38 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Han-Wen Nienhuys <address@hidden> writes:

> address@hidden writes:
>> There is one thing I have not done yet: adding a rule in convert-ly.
>
> I'm not sure that it will be feasible to add convert-ly rules, since
> you have to deal with correctly nesting { }  

I've added a rule that should catch some basic cases.

> I'm not sure if it's feasible, but one thing that I did have in mind
> is to convert
>
>      { c b \bold { d e } f g }
>
> to
>
>      { c b \bold  d \bold e f g }
>
> ie. flattening a (markup_head_1_list + markup_list) that is inside a
> markup_list. I think that you will need some more rules, but can you
> try if you can make it work? Then, we won't have to introduce
> additional artificial line-markup commands.

Ok, I think I got it. This is not very straightforward.

  348 full_markup: MARKUP_IDENTIFIER

  349 @21: /* vide */

  350 full_markup: MARKUP @21 markup_top

  351 markup_top: markup_composed_list
  352           | markup_head_1_list simple_markup
  353           | simple_markup
  354           | markup_braced_list

  355 markup_composed_list: markup_head_1_list markup_braced_list

  356 markup_braced_list: '{' markup_braced_list_body '}'

  357 markup_braced_list_body: /* vide */
  358                        | markup_braced_list_body markup
  359                        | markup_braced_list_body markup_composed_list

  360 markup_head_1_item: MARKUP_HEAD_MARKUP0
  361                   | MARKUP_HEAD_SCM0_MARKUP1 embedded_scm
  362                   | MARKUP_HEAD_SCM0_SCM1_MARKUP2 embedded_scm 
embedded_scm

  363 markup_head_1_list: markup_head_1_item
  364                   | markup_head_1_list markup_head_1_item

  365 simple_markup: STRING
  366              | MARKUP_IDENTIFIER
  367              | STRING_IDENTIFIER

  368 @22: /* vide */

  369 simple_markup: SCORE @22 '{' score_body '}'
  370              | MARKUP_HEAD_SCM0 embedded_scm
  371              | MARKUP_HEAD_SCM0_SCM1_SCM2 embedded_scm embedded_scm 
embedded_scm
  372              | MARKUP_HEAD_SCM0_SCM1 embedded_scm embedded_scm
  373              | MARKUP_HEAD_EMPTY
  374              | MARKUP_HEAD_LIST0 markup_braced_list
  375              | MARKUP_HEAD_MARKUP0_MARKUP1 markup markup

  376 markup: markup_head_1_list simple_markup
  377       | simple_markup
  378       | markup_braced_list


make web runs OK, except in input/regression where it fails on
ancient-fonts.ly -- I guess this is not related.

Should I commit?

oh, maybe I should add a note in NEWS.texi, as this is a syntax
change.

nicolas

Index: Documentation/user/changing-defaults.itely
===================================================================
RCS file: 
/cvsroot/lilypond/lilypond/Documentation/user/changing-defaults.itely,v
retrieving revision 1.93
diff -u -r1.93 changing-defaults.itely
--- Documentation/user/changing-defaults.itely  26 Nov 2004 13:33:30 -0000      
1.93
+++ Documentation/user/changing-defaults.itely  28 Nov 2004 17:02:10 -0000
@@ -1461,14 +1461,14 @@
 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: Documentation/user/music-glossary.tely
===================================================================
RCS file: /cvsroot/lilypond/lilypond/Documentation/user/music-glossary.tely,v
retrieving revision 1.93
diff -u -r1.93 music-glossary.tely
--- Documentation/user/music-glossary.tely      13 Nov 2004 20:46:35 -0000      
1.93
+++ Documentation/user/music-glossary.tely      28 Nov 2004 17:02:11 -0000
@@ -1145,7 +1145,7 @@
   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: Documentation/user/notation.itely
===================================================================
RCS file: /cvsroot/lilypond/lilypond/Documentation/user/notation.itely,v
retrieving revision 1.157
diff -u -r1.157 notation.itely
--- Documentation/user/notation.itely   23 Nov 2004 00:16:16 -0000      1.157
+++ Documentation/user/notation.itely   28 Nov 2004 17:02:14 -0000
@@ -5153,8 +5153,8 @@
 
 @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
 
@@ -5922,24 +5922,24 @@
 {
   \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 {
@@ -6436,22 +6436,22 @@
 
 @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
 
@@ -7734,9 +7734,9 @@
 % 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: input/wilhelmus.ly
===================================================================
RCS file: /cvsroot/lilypond/lilypond/input/wilhelmus.ly,v
retrieving revision 1.17
diff -u -r1.17 wilhelmus.ly
--- input/wilhelmus.ly  30 Oct 2004 20:55:15 -0000      1.17
+++ input/wilhelmus.ly  28 Nov 2004 17:02:15 -0000
@@ -1,4 +1,4 @@
-\version "2.4.0"
+\version "2.5.1"
 
 \header {
   texidoc = "Wilhelmus van Nassouwe"
@@ -142,7 +142,7 @@
 
 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: input/mutopia/J.S.Bach/wtk1-fugue2.ly
===================================================================
RCS file: /cvsroot/lilypond/lilypond/input/mutopia/J.S.Bach/wtk1-fugue2.ly,v
retrieving revision 1.31
diff -u -r1.31 wtk1-fugue2.ly
--- input/mutopia/J.S.Bach/wtk1-fugue2.ly       30 Oct 2004 20:55:15 -0000      
1.31
+++ input/mutopia/J.S.Bach/wtk1-fugue2.ly       28 Nov 2004 17:02:15 -0000
@@ -17,17 +17,17 @@
     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 @@
 %}
 
 
-\version "2.4.0"
+\version "2.5.1"
 
 
 
Index: input/mutopia/R.Schumann/romanze-op28-2.ly
===================================================================
RCS file: 
/cvsroot/lilypond/lilypond/input/mutopia/R.Schumann/romanze-op28-2.ly,v
retrieving revision 1.52
diff -u -r1.52 romanze-op28-2.ly
--- input/mutopia/R.Schumann/romanze-op28-2.ly  30 Oct 2004 20:55:15 -0000      
1.52
+++ input/mutopia/R.Schumann/romanze-op28-2.ly  28 Nov 2004 17:02:16 -0000
@@ -5,7 +5,7 @@
 
 #(set-global-staff-size 16)
 
-\version "2.4.0"
+\version "2.5.1"
 
 \header {
   title = "Romanzen"
@@ -259,7 +259,7 @@
     \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: input/mutopia/W.A.Mozart/mozart-hrn-3.ly
===================================================================
RCS file: /cvsroot/lilypond/lilypond/input/mutopia/W.A.Mozart/mozart-hrn-3.ly,v
retrieving revision 1.31
diff -u -r1.31 mozart-hrn-3.ly
--- input/mutopia/W.A.Mozart/mozart-hrn-3.ly    30 Oct 2004 20:55:15 -0000      
1.31
+++ input/mutopia/W.A.Mozart/mozart-hrn-3.ly    28 Nov 2004 17:02:16 -0000
@@ -20,17 +20,17 @@
   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 @@
 
 %}
 
-\version "2.4.0"
+\version "2.5.1"
 
 \include "mozart-hrn3-defs.ily"
 \include "mozart-hrn3-allegro.ily"
Index: input/regression/instrument-name-markup.ly
===================================================================
RCS file: 
/cvsroot/lilypond/lilypond/input/regression/instrument-name-markup.ly,v
retrieving revision 1.25
diff -u -r1.25 instrument-name-markup.ly
--- input/regression/instrument-name-markup.ly  30 Oct 2004 20:55:15 -0000      
1.25
+++ input/regression/instrument-name-markup.ly  28 Nov 2004 17:02:16 -0000
@@ -7,14 +7,14 @@
 }
 
 
-\version "2.4.0"
+\version "2.5.1"
 
 
 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: input/regression/markup-score.ly
===================================================================
RCS file: /cvsroot/lilypond/lilypond/input/regression/markup-score.ly,v
retrieving revision 1.5
diff -u -r1.5 markup-score.ly
--- input/regression/markup-score.ly    30 Oct 2004 20:55:16 -0000      1.5
+++ input/regression/markup-score.ly    28 Nov 2004 17:02:16 -0000
@@ -2,7 +2,7 @@
     texidoc = "Use \\score block as markup command."
 }
 
-\version "2.4.0"
+\version "2.5.1"
 
 tuning = \markup {
     \score {
@@ -19,7 +19,7 @@
 \header {
     title = "Solo Cello Suites"
     subtitle = "Suite IV"
-    subsubtitle = \markup { \fill-line < { "Originalstimmung: " \tuning } > }
+    subsubtitle = \markup { \fill-line { { "Originalstimmung: " \tuning } } }
 }
 
 \relative {
Index: input/regression/markup-stack.ly
===================================================================
RCS file: /cvsroot/lilypond/lilypond/input/regression/markup-stack.ly,v
retrieving revision 1.26
diff -u -r1.26 markup-stack.ly
--- input/regression/markup-stack.ly    30 Oct 2004 20:55:16 -0000      1.26
+++ input/regression/markup-stack.ly    28 Nov 2004 17:02:16 -0000
@@ -1,6 +1,6 @@
-\version "2.4.0"
+\version "2.5.1"
 \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: input/regression/multi-measure-rest-text.ly
===================================================================
RCS file: 
/cvsroot/lilypond/lilypond/input/regression/multi-measure-rest-text.ly,v
retrieving revision 1.24
diff -u -r1.24 multi-measure-rest-text.ly
--- input/regression/multi-measure-rest-text.ly 30 Oct 2004 20:55:16 -0000      
1.24
+++ input/regression/multi-measure-rest-text.ly 28 Nov 2004 17:02:16 -0000
@@ -1,4 +1,4 @@
-\version "2.4.0"
+\version "2.5.1"
 
 \header  {
 
@@ -13,7 +13,7 @@
 \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: input/regression/new-markup-scheme.ly
===================================================================
RCS file: /cvsroot/lilypond/lilypond/input/regression/new-markup-scheme.ly,v
retrieving revision 1.16
diff -u -r1.16 new-markup-scheme.ly
--- input/regression/new-markup-scheme.ly       30 Oct 2004 20:55:16 -0000      
1.16
+++ input/regression/new-markup-scheme.ly       28 Nov 2004 17:02:16 -0000
@@ -5,7 +5,7 @@
     texts using a similar syntax as @code{\\markup}."
 
     }
-\version "2.4.0"
+\version "2.5.1"
 \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: input/regression/new-markup-syntax.ly
===================================================================
RCS file: /cvsroot/lilypond/lilypond/input/regression/new-markup-syntax.ly,v
retrieving revision 1.35
diff -u -r1.35 new-markup-syntax.ly
--- input/regression/new-markup-syntax.ly       30 Oct 2004 20:55:16 -0000      
1.35
+++ input/regression/new-markup-syntax.ly       28 Nov 2004 17:02:16 -0000
@@ -2,7 +2,7 @@
 texidoc = "With the new markup syntax, text may be written in various manners."
 }
 
-\version "2.4.0"
+\version "2.5.1"
 
 
 \score {
@@ -13,7 +13,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"
@@ -26,7 +26,7 @@
                \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: input/test/coriolan-margin.ly
===================================================================
RCS file: /cvsroot/lilypond/lilypond/input/test/coriolan-margin.ly,v
retrieving revision 1.60
diff -u -r1.60 coriolan-margin.ly
--- input/test/coriolan-margin.ly       30 Oct 2004 20:55:16 -0000      1.60
+++ input/test/coriolan-margin.ly       28 Nov 2004 17:02:16 -0000
@@ -1,5 +1,5 @@
 
-\version "2.4.0"
+\version "2.5.1"
 
 
 % Ugh, we need to override some LaTeX titling stuff
@@ -42,7 +42,7 @@
 }
 
 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 @@
 }
 
 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 @@
 }
 
 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: input/test/title-markup.ly
===================================================================
RCS file: /cvsroot/lilypond/lilypond/input/test/title-markup.ly,v
retrieving revision 1.48
diff -u -r1.48 title-markup.ly
--- input/test/title-markup.ly  30 Oct 2004 20:55:16 -0000      1.48
+++ input/test/title-markup.ly  28 Nov 2004 17:02:16 -0000
@@ -1,4 +1,4 @@
-\version "2.4.0"
+\version "2.5.1"
 
 %{
    Markup titles also available for direct PostScript output:
@@ -37,7 +37,7 @@
 }
     
 sizeTest = \markup {
-       \column <
+       \column {
             { \normalsize "normalsize"
               \hspace #5
               \smaller "smaller"
@@ -55,7 +55,7 @@
               \hspace #5
               \bigger \bigger \bigger "bigger"
             }
-       >
+       }
 }
 
 \encoding "latin1"
@@ -85,7 +85,7 @@
     piece = "Piece"
 
     %% Override automatic book title
-    %% bookTitle = \markup { \fill-line < \huge\bold \title > > }
+    %% bookTitle = \markup { \fill-line { \huge\bold \title } }
 }
 
 \book {
Index: lily/lexer.ll
===================================================================
RCS file: /cvsroot/lilypond/lilypond/lily/lexer.ll,v
retrieving revision 1.155
diff -u -r1.155 lexer.ll
--- lily/lexer.ll       23 Nov 2004 20:09:16 -0000      1.155
+++ lily/lexer.ll       28 Nov 2004 17:02:16 -0000
@@ -485,12 +485,6 @@
        \" {
                start_quote ();
        }
-       \< {
-               return '<';
-       }
-       \> {
-               return '>';
-       }
        \\score {
                return SCORE;
        }
@@ -530,7 +524,7 @@
        [{}]    {
                return YYText ()[0];
        }
-       [^<>#{}"\\ \t\n\r\f]+ {
+       [^#{}"\\ \t\n\r\f]+ {
                String s (YYText ()); 
 
                char c = s[s.length () - 1];
Index: lily/parser.yy
===================================================================
RCS file: /cvsroot/lilypond/lilypond/lily/parser.yy,v
retrieving revision 1.443
diff -u -r1.443 parser.yy
--- lily/parser.yy      28 Nov 2004 00:47:15 -0000      1.443
+++ lily/parser.yy      28 Nov 2004 17:02:17 -0000
@@ -444,7 +444,7 @@
 %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 '?' { $$ ++; }
        ;
 
-
+/*
+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 @@
                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: ly/titling-init.ly
===================================================================
RCS file: /cvsroot/lilypond/lilypond/ly/titling-init.ly,v
retrieving revision 1.2
diff -u -r1.2 titling-init.ly
--- ly/titling-init.ly  21 Nov 2004 18:19:10 -0000      1.2
+++ ly/titling-init.ly  28 Nov 2004 17:02:17 -0000
@@ -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 @@
                     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 @@
                     empty-stencil
                   ))
       \fromproperty #'header:tagline
-    >
-  >
+    }
+  }
 }
 
Index: scm/new-markup.scm
===================================================================
RCS file: /cvsroot/lilypond/lilypond/scm/new-markup.scm,v
retrieving revision 1.79
diff -u -r1.79 new-markup.scm
--- scm/new-markup.scm  10 Oct 2004 11:42:06 -0000      1.79
+++ scm/new-markup.scm  28 Nov 2004 17:02:18 -0000
@@ -332,6 +332,24 @@
     (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
 
 (define (markup-function? x)
Index: scripts/convert-ly.py
===================================================================
RCS file: /cvsroot/lilypond/lilypond/scripts/convert-ly.py,v
retrieving revision 1.216
diff -u -r1.216 convert-ly.py
--- scripts/convert-ly.py       21 Nov 2004 18:19:11 -0000      1.216
+++ scripts/convert-ly.py       28 Nov 2004 17:02:19 -0000
@@ -2280,7 +2280,18 @@
                     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      

reply via email to

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