]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4505: Add partial \override and \set commands
authorDavid Kastrup <dak@gnu.org>
Sun, 12 Jul 2015 16:16:58 +0000 (18:16 +0200)
committerDavid Kastrup <dak@gnu.org>
Tue, 21 Jul 2015 05:07:13 +0000 (07:07 +0200)
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.

lily/include/lily-imports.hh
lily/lily-imports.cc
lily/parser.yy

index 383896a021614e54b3fec2ec87399cafb6c0c2c4..0887c224411d54948244b3cc8da1062cc3b14443 100644 (file)
@@ -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;
index 3a694f9d10e23bd7d56314c955ca5736edb88080..3d95c8c828a673334183bf3e6f3ff4db30a6b19c 100644 (file)
@@ -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");
index 48ada375661dd85f2b44e46e298016c971af5905..23c024e9b7e590c42327b4ab69f972a0e76309ac 100644 (file)
@@ -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);