From: David Kastrup Date: Mon, 30 Jan 2012 21:15:03 +0000 (+0100) Subject: Add location info to chords; issue 1022 X-Git-Tag: release/2.15.28-1~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b93ef28470061b0d777269d289e8a256bb876b82;p=lilypond.git Add location info to chords; issue 1022 --- diff --git a/lily/parser.yy b/lily/parser.yy index 71b476cca0..da164e48c4 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -223,7 +223,7 @@ static Music *make_music_with_input (SCM name, Input where); SCM check_scheme_arg (Lily_parser *parser, Input loc, SCM arg, SCM args, SCM pred); SCM loc_on_music (Input loc, SCM arg); -SCM make_chord_elements (SCM pitch, SCM dur, SCM modification_list); +SCM make_chord_elements (Input loc, SCM pitch, SCM dur, SCM modification_list); SCM make_chord_step (int step, Rational alter); SCM make_simple_markup (SCM a); bool is_duration (int t); @@ -2789,11 +2789,11 @@ lyric_element_music: new_chord: steno_tonic_pitch optional_notemode_duration { - $$ = make_chord_elements ($1, $2, SCM_EOL); + $$ = make_chord_elements (@$, $1, $2, SCM_EOL); } | steno_tonic_pitch optional_notemode_duration chord_separator chord_items { SCM its = scm_reverse_x ($4, SCM_EOL); - $$ = make_chord_elements ($1, $2, scm_cons ($3, its)); + $$ = make_chord_elements (@$, $1, $2, scm_cons ($3, its)); } ; @@ -3315,10 +3315,15 @@ make_chord_step (int step, Rational alter) SCM -make_chord_elements (SCM pitch, SCM dur, SCM modification_list) +make_chord_elements (Input loc, SCM pitch, SCM dur, SCM modification_list) { SCM chord_ctor = ly_lily_module_constant ("construct-chord-elements"); - return scm_call_3 (chord_ctor, pitch, dur, modification_list); + SCM res = scm_call_3 (chord_ctor, pitch, dur, modification_list); + for (SCM s = res; scm_is_pair (s); s = scm_cdr (s)) + { + unsmob_music (scm_car (s))->set_spot (loc); + } + return res; } int