]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4811/1: Allow property paths as scalars and in assignments
authorDavid Kastrup <dak@gnu.org>
Tue, 22 Mar 2016 23:05:16 +0000 (00:05 +0100)
committerDavid Kastrup <dak@gnu.org>
Tue, 29 Mar 2016 05:59:24 +0000 (07:59 +0200)
They cannot be embedded LilyPond since #{ 2 . 2 #} already is valid
music.

Property paths must have at least two syntactic elements to be
recognized as such and must not start with a Scheme expression.
Technically, 3 . #'() counts.

This affects overrides and sets as well.

lily/parser.yy

index 7a11d05fc95f5c09479b693f6527ac216340257a..b8849e8f4acaa79447fe0a81daa4d6e0d8a218d3 100644 (file)
@@ -674,6 +674,14 @@ assignment:
 identifier_init:
        identifier_init_nonumber
        | number_expression
+       | symbol_list_part_bare '.' property_path
+       {
+               $$ = scm_reverse_x ($1, $3);
+       }
+       | symbol_list_part_bare ',' property_path
+       {
+               $$ = scm_reverse_x ($1, $3);
+       }
        | post_event_nofinger post_events
        {
                $$ = scm_reverse_x ($2, SCM_EOL);
@@ -1726,6 +1734,21 @@ symbol_list_element:
        | UNSIGNED
        ;
 
+symbol_list_part_bare:
+       STRING
+       {
+               $$ = try_string_variants (Lily::key_list_p, $1);
+               if (SCM_UNBNDP ($$)) {
+                       parser->parser_error (@1, _("not a key"));
+                       $$ = SCM_EOL;
+               } else
+                       $$ = scm_reverse ($$);
+       }
+       | UNSIGNED
+       {
+               $$ = scm_list_1 ($1);
+       }
+       ;
 
 function_arglist_nonbackup:
        function_arglist_common
@@ -2883,6 +2906,14 @@ scalar:
                $$ = scm_difference ($2, SCM_UNDEFINED);
        }
        | string
+       | symbol_list_part_bare '.' property_path
+       {
+               $$ = scm_reverse_x ($1, $3);
+       }
+       | symbol_list_part_bare ',' property_path
+       {
+               $$ = scm_reverse_x ($1, $3);
+       }
        ;
 
 event_chord: