From: David Kastrup Date: Tue, 12 Mar 2013 11:24:34 +0000 (+0100) Subject: Issue 3237: Harmonize point-and-click information for #xxx and $xxx X-Git-Tag: release/2.17.15-1~17^2~21 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e1b20cd26cef689da17876e4befaeb171eca3486;p=lilypond.git Issue 3237: Harmonize point-and-click information for #xxx and $xxx Both #xxx and $xxx now retain any preexisting origin information when producing a music expression. In contrast, \xxx continues receiving the origin information pertaining to the current location even if previous point-and-click information exists. This is consistent with the point-and-click information for music functions as a whole corresponding to the point of call, while the individual arguments, if separate music expressions, retain any preexisting origin. --- diff --git a/lily/lexer.ll b/lily/lexer.ll index c1d3dd86a5..0df70e2008 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -925,6 +925,11 @@ Lily_lexer::scan_escaped_word (string str) return i; SCM sid = lookup_identifier (str); + if (Music *m = unsmob_music (sid)) + { + m->set_spot (override_input (last_input_)); + } + if (sid != SCM_UNDEFINED) return scan_scm_id (sid); @@ -1084,19 +1089,26 @@ Lily_lexer::eval_scm (SCM readerdata, char extra_token) sval = scm_struct_ref (sval, SCM_INUM0); if (scm_is_pair (sval)) { - for (SCM v = scm_reverse (scm_cdr (sval)); - scm_is_pair (v); - v = scm_cdr (v)) + for (SCM p = scm_reverse (scm_cdr (sval)); + scm_is_pair (p); + p = scm_cdr (p)) { + SCM v = scm_car (p); + if (Music *m = unsmob_music (v)) + { + if (!unsmob_input (m->get_property ("origin"))) + m->set_spot (override_input (last_input_)); + } + int token; switch (extra_token) { case '$': - token = scan_scm_id (scm_car (v)); + token = scan_scm_id (v); if (!scm_is_eq (yylval, SCM_UNSPECIFIED)) push_extra_token (token, yylval); break; case '#': - push_extra_token (SCM_IDENTIFIER, scm_car (v)); + push_extra_token (SCM_IDENTIFIER, v); break; } } @@ -1105,6 +1117,12 @@ Lily_lexer::eval_scm (SCM readerdata, char extra_token) sval = SCM_UNSPECIFIED; } + if (Music *m = unsmob_music (sval)) + { + if (!unsmob_input (m->get_property ("origin"))) + m->set_spot (override_input (last_input_)); + } + return sval; } diff --git a/lily/parser.yy b/lily/parser.yy index 478d053775..0197fe9d93 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -3438,10 +3438,6 @@ Lily_lexer::try_special_identifiers (SCM *destination, SCM sid) } else if (Music *mus = unsmob_music (sid)) { mus = mus->clone (); *destination = mus->self_scm (); - unsmob_music (*destination)-> - set_property ("origin", - make_input (override_input (last_input_))); - bool is_event = mus->is_mus_type ("post-event"); mus->unprotect (); return is_event ? EVENT_IDENTIFIER : MUSIC_IDENTIFIER;