source file of the GNU LilyPond music typesetter
- (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
%type <book> book_body
%type <i> bare_unsigned
-%type <i> figured_bass_alteration
+%type <scm> figured_bass_alteration
%type <i> dots
%type <i> exclamations
%type <i> optional_rest
%type <scm> pitch_also_in_chords
%type <scm> post_events
%type <scm> property_operation
+%type <scm> property_path
%type <scm> scalar
%type <scm> script_abbreviation
%type <scm> simple_chord_elements
}
;
+
+property_path:
+ embedded_scm {
+ $$ = scm_cons ($1, SCM_EOL);
+ }
+ | property_path embedded_scm {
+ $$ = scm_cons ($2, $1);
+ }
+ ;
+
property_operation:
STRING '=' scalar {
$$ = scm_list_3 (ly_symbol2scm ("assign"),
$$ = scm_list_2 (ly_symbol2scm ("unset"),
scm_string_to_symbol ($2));
}
- | OVERRIDE simple_string embedded_scm '=' embedded_scm {
- $$ = scm_list_4 (ly_symbol2scm ("push"),
- scm_string_to_symbol ($2), $5, $3);
- }
- | OVERRIDE simple_string embedded_scm embedded_scm '=' embedded_scm {
- $$ = scm_list_5 (ly_symbol2scm ("push"),
- scm_string_to_symbol ($2), $6, $4, $3);
+ | OVERRIDE simple_string property_path '=' embedded_scm {
+ $$ = scm_append (scm_list_2 (scm_list_3 (ly_symbol2scm ("push"),
+ scm_string_to_symbol ($2), $5),
+ $3));
}
| REVERT simple_string embedded_scm {
$$ = scm_list_3 (ly_symbol2scm ("pop"),
;
simple_music_property_def:
- OVERRIDE context_prop_spec embedded_scm '=' scalar {
- $$ = scm_list_5 (scm_car ($2),
- ly_symbol2scm ("OverrideProperty"),
- scm_cadr ($2),
- $5, $3);
- }
- | OVERRIDE context_prop_spec embedded_scm embedded_scm '=' scalar {
- $$ = scm_list_n (scm_car ($2),
- ly_symbol2scm ("OverrideProperty"),
- scm_cadr ($2),
- $6, $4, $3, SCM_UNDEFINED);
+ OVERRIDE context_prop_spec property_path '=' scalar {
+ $$ = scm_append (scm_list_2 (scm_list_n (scm_car ($2),
+ ly_symbol2scm ("OverrideProperty"),
+ scm_cadr ($2),
+ $5, SCM_UNDEFINED),
+ $3));
}
| REVERT context_prop_spec embedded_scm {
$$ = scm_list_4 (scm_car ($2),
;
figured_bass_alteration:
- '-' { $$ = -2; }
- | '+' { $$ = 2; }
- | '!' { $$ = 0; }
+ '-' { $$ = ly_rational2scm (FLAT_ALTERATION); }
+ | '+' { $$ = ly_rational2scm (SHARP_ALTERATION); }
+ | '!' { $$ = scm_from_int (0); }
;
bass_figure:
}
| bass_figure figured_bass_alteration {
Music *m = unsmob_music ($1);
- if ($2) {
+ if (scm_to_double ($2)) {
SCM salter = m->get_property ("alteration");
- int alter = scm_is_number (salter) ? scm_to_int (salter) : 0;
+ SCM alter = scm_is_number (salter) ? salter : scm_from_int (0);
m->set_property ("alteration",
- scm_from_int (alter + $2));
+ scm_sum (alter, $2));
} else {
m->set_property ("alteration", scm_from_int (0));
}