From: David Kastrup Date: Sun, 12 Jul 2015 16:16:58 +0000 (+0200) Subject: Issue 4505: Add partial \override and \set commands X-Git-Tag: release/2.19.24-1~5^2~26 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=47ce0f0eb601fd3d8fd38e9782e74e21c8b76205;p=lilypond.git Issue 4505: Add partial \override and \set commands This allows \set and \override commands to be stopped short after their `=' sign in order to be used in the manner of partial music functions. --- diff --git a/lily/include/lily-imports.hh b/lily/include/lily-imports.hh index 383896a021..0887c22441 100644 --- a/lily/include/lily-imports.hh +++ b/lily/include/lily-imports.hh @@ -87,6 +87,8 @@ namespace Lily { #endif extern Variable f_parser; extern Variable percussion_p; + extern Variable property_override; + extern Variable property_set; extern Variable pure_chain_offset_callback; extern Variable remove_stencil_warnings; extern Variable scale_layout; diff --git a/lily/lily-imports.cc b/lily/lily-imports.cc index 3a694f9d10..3d95c8c828 100644 --- a/lily/lily-imports.cc +++ b/lily/lily-imports.cc @@ -81,6 +81,8 @@ namespace Lily { #endif Variable f_parser ("%parser"); Variable percussion_p ("percussion?"); + Variable property_override ("propertyOverride"); + Variable property_set ("propertySet"); Variable pure_chain_offset_callback ("pure-chain-offset-callback"); Variable remove_stencil_warnings ("remove-stencil-warnings"); Variable scale_layout ("scale-layout"); diff --git a/lily/parser.yy b/lily/parser.yy index 48ada37566..23c024e9b7 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -717,6 +717,14 @@ partial_function: { $$ = scm_acons ($1, $2, SCM_EOL); } + | OVERRIDE grob_prop_path '=' + { + $$ = scm_acons (Lily::property_override, scm_list_1 ($2), SCM_EOL); + } + | SET context_prop_spec '=' + { + $$ = scm_acons (Lily::property_set, scm_list_1 ($2), SCM_EOL); + } | MUSIC_FUNCTION EXPECT_SCM function_arglist_optional partial_function { $$ = scm_acons ($1, $3, $4); @@ -729,6 +737,14 @@ partial_function: { $$ = scm_acons ($1, $3, $4); } + | OVERRIDE grob_prop_path '=' partial_function + { + $$ = scm_acons (Lily::property_override, scm_list_1 ($2), $4); + } + | SET context_prop_spec '=' partial_function + { + $$ = scm_acons (Lily::property_set, scm_list_1 ($2), $4); + } | MUSIC_FUNCTION EXPECT_OPTIONAL EXPECT_SCM function_arglist_nonbackup partial_function { $$ = scm_acons ($1, $4, $5);