X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fparser.yy;h=4bf3c9d191e98d5585404c45d16b2aa3858fb2ed;hb=49c5e7ba9c44a60281f45a802a77e006570c7ac0;hp=0d42a60a18ea1663bc3a5f1bd260de0457ca208c;hpb=6303342f277faaf90c183f868c3ff6b3bef98ae5;p=lilypond.git diff --git a/lily/parser.yy b/lily/parser.yy index 0d42a60a18..4bf3c9d191 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2006 Han-Wen Nienhuys + (c) 1997--2007 Han-Wen Nienhuys Jan Nieuwenhuizen */ @@ -300,7 +300,7 @@ If we give names, Bison complains. %type book_body %type bare_unsigned -%type figured_bass_alteration +%type figured_bass_alteration %type dots %type exclamations %type optional_rest @@ -410,6 +410,7 @@ If we give names, Bison complains. %type pitch_also_in_chords %type post_events %type property_operation +%type property_path %type scalar %type script_abbreviation %type simple_chord_elements @@ -1122,6 +1123,16 @@ context_change: } ; + +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"), @@ -1131,13 +1142,10 @@ property_operation: $$ = 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"), @@ -1183,17 +1191,12 @@ context_prop_spec: ; 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), @@ -1824,9 +1827,9 @@ bass_number: ; figured_bass_alteration: - '-' { $$ = -2; } - | '+' { $$ = 2; } - | '!' { $$ = 0; } + '-' { $$ = ly_rational2scm (FLAT_ALTERATION); } + | '+' { $$ = ly_rational2scm (SHARP_ALTERATION); } + | '!' { $$ = scm_from_int (0); } ; bass_figure: @@ -1851,11 +1854,11 @@ 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)); }