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-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>
}
}
-<INITIAL,lyrics,notes>\\encoding{WHITE}* {
+<INITIAL,lyrics,figures,notes>\\encoding{WHITE}* {
yy_push_state (encoding);
}
<INITIAL,chords,lyrics,notes,figures>\\version{WHITE}* {
<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] == ';'))
yylval.i = String_convert::dec2int (String (YYText () +1));
return E_UNSIGNED;
}
-
\" {
start_quote ();
}
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 ();
$$ = 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");
%% doing
%% def-music-function in a .scm causes crash.
-quoteDuring = #
+cueDuring = #
(def-music-function
(location what dir main-music)
(string? ly:dir? ly:music?)
(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:
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
################################