]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/new-quote-iterator.cc (construct_children): set
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 7 Nov 2004 18:46:26 +0000 (18:46 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 7 Nov 2004 18:46:26 +0000 (18:46 +0000)
quote_outlet_ if no quoted-context-{id,type} specified.

* scripts/convert-ly.py (conv): \quote -> \quoteDuring.

* lily/parser.yy (command_element): remove \quote.

* ly/music-functions-init.ly (location): add quoteDuring music
function.

* lily/lexer.ll: allow \encoding in lyrics as well.  Remove
optional semicolon. (backportme)

ChangeLog
lily/lexer.ll
lily/new-quote-iterator.cc
lily/parser.yy
ly/music-functions-init.ly
scripts/convert-ly.py

index 23ff2d909d855ec07c618d53be09c6c3ae1099ec..dfc0e767fc4e7779fbdb6d352a1bc16f7754d849 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,17 @@
 2004-11-07  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
-       * lily/lexer.ll: allow \encoding in lyrics as well.
+       * lily/new-quote-iterator.cc (construct_children): set
+       quote_outlet_ if no quoted-context-{id,type} specified.
+
+       * scripts/convert-ly.py (conv): \quote -> \quoteDuring.
+
+       * lily/parser.yy (command_element): remove \quote.
+
+       * ly/music-functions-init.ly (location): add quoteDuring music
+       function. 
+
+       * lily/lexer.ll: allow \encoding in lyrics as well.  Remove
+       optional semicolon. (backportme)
 
 2004-11-06  Jan Nieuwenhuizen  <janneke@gnu.org>
 
index 54c4c3cd0c8009b874771f2d9549c109cce5f891..a1c7623703f107f67a50401d80efc87e186c89e6 100644 (file)
@@ -164,7 +164,7 @@ HYPHEN              --
   }
 }
 
-<INITIAL,lyrics,notes>\\encoding{WHITE}* {
+<INITIAL,lyrics,figures,notes>\\encoding{WHITE}* {
        yy_push_state (encoding);
 }
 <INITIAL,chords,lyrics,notes,figures>\\version{WHITE}* {
@@ -243,16 +243,14 @@ HYPHEN            --
 <INITIAL,chords,lyrics,figures,notes>\\include           {
        yy_push_state (incl);
 }
-<incl>\"[^"]*\";?   { /* got the include file name */
-/* FIXME: semicolon? */
+<incl>\"[^"]*\"   { /* got the include file name */
        String s (YYText ()+1);
        s = s.left_string (s.index_last ('"'));
 
        new_input (s, sources_);
        yy_pop_state ();
 }
-<incl>\\{BLACK}*;?{WHITE} { /* got the include identifier */
-/* FIXME: semicolon? */
+<incl>\\{BLACK}*{WHITE} { /* got the include identifier */
        String s = YYText () + 1;
        strip_trailing_white (s);
        if (s.length () && (s[s.length () - 1] == ';'))
@@ -356,7 +354,6 @@ HYPHEN              --
                yylval.i = String_convert::dec2int (String (YYText () +1));
                return E_UNSIGNED;
        }
-
        \" {
                start_quote ();
        }
index e3928cfcef2d1e140e56eefc7b7241985c308ffc..e1bdf20805085a43d6dc482192a794557a28f5b7 100644 (file)
@@ -104,9 +104,17 @@ New_quote_iterator::construct_children ()
   SCM name = get_music ()->get_property ("quoted-context-type");
   SCM id = get_music ()->get_property ("quoted-context-id");
 
-  Context *cue_context = get_outlet()->find_create_context (name,
-                                                           ly_scm2string (id), SCM_EOL);
-  quote_outlet_.set_context (cue_context);
+  if (scm_is_string (id)
+      && scm_is_symbol (name))
+    {
+      Context *cue_context = get_outlet()->find_create_context (name,
+                                                               ly_scm2string (id), SCM_EOL);
+      quote_outlet_.set_context (cue_context);
+    }
+  else
+    {
+      quote_outlet_.set_context (get_outlet ());
+    }
   
   Moment now = get_outlet ()->now_mom ();
   Moment stop = now + get_music()->get_length ();
index a193206ffc1a5a04b083bc9f94c6bff283452d30..54edb3afdc38da8e521e8450ac2eaf08be36ad05 100644 (file)
@@ -1598,14 +1598,6 @@ command_element:
 
                $$ = skip;
        }
-       | QUOTE STRING duration_length {
-               Music *quote = MY_MAKE_MUSIC ("QuoteMusic");
-               quote->set_property ("duration", $3);
-               quote->set_property ("quoted-music-name", $2);
-               quote->set_spot (THIS->here_input ());
-
-               $$ = quote;
-       }
        | OCTAVE { THIS->push_spot (); }
          pitch {
                Music *m = MY_MAKE_MUSIC ("RelativeOctaveCheck");
index cd9914887a365cc86027940fa7386cb7189fa57f..6e074d0a14a70ec52b9a0cb49dbd68abf9691930 100644 (file)
@@ -77,7 +77,7 @@ keepWithTag =
 %% doing
 %% def-music-function in a .scm causes crash.
 
-quoteDuring = #
+cueDuring = #
 (def-music-function
   (location what dir main-music)
   (string? ly:dir? ly:music?)
@@ -113,6 +113,16 @@ quoteDuring = #
     (set! (ly:music-property quote-music 'element) main-music)
     return-value))
 
+quoteDuring = #
+(def-music-function
+  (location what main-music)
+  (string? ly:music?)
+  (make-music 'NewQuoteMusic
+             'element main-music
+             'quoted-music-name what
+             'origin location))
+
+
 %{
 
 TODO:
index 4ca282ea992ef92e0669a6edb084369c67653a2a..5c5ea69d36c7433f26a18f110ffd54e466581e93 100644 (file)
@@ -2234,6 +2234,21 @@ conversions.append (((2, 4, 0),
                     conv,
                     ''))
 
+
+# nothing, just to make version numbers look good.
+def conv (str):
+       str = re.sub (r'\\quote\s+"?([a-zA-Z0-9]+)"?\s+([0-9.*/]+)',
+                     r'\\quoteDuring #"\1" { \skip \2 }',
+                     str
+                     )
+       return str
+
+conversions.append (((2, 5, 0),
+                    conv,
+                    ''))
+
+
+
 ################################
 #      END OF CONVERSIONS      
 ################################