]> git.donarmstrong.com Git - lilypond.git/commitdiff
Refactor grammar, folding complex_music into composite_music
authorDavid Kastrup <dak@gnu.org>
Mon, 4 Aug 2014 07:55:17 +0000 (09:55 +0200)
committerDavid Kastrup <dak@gnu.org>
Sun, 14 Sep 2014 05:44:55 +0000 (07:44 +0200)
lily/parser.yy

index eac4dad0f3aa397367160536a3df04907fcc1266..89c4a0036a41c95b8bb9624b5bbdacd5d6f6ac99 100644 (file)
@@ -1404,8 +1404,31 @@ context_mod_list:
         }
         ;
 
+context_prefix:
+       CONTEXT symbol optional_id optional_context_mod {
+                Context_mod *ctxmod = Context_mod::unsmob ($4);
+                SCM mods = SCM_EOL;
+                if (ctxmod)
+                        mods = ctxmod->get_mods ();
+               $$ = START_MAKE_SYNTAX ("context-specification", $2, $3, mods, SCM_BOOL_F);
+       }
+       | NEWCONTEXT symbol optional_id optional_context_mod {
+                Context_mod *ctxmod = Context_mod::unsmob ($4);
+                SCM mods = SCM_EOL;
+                if (ctxmod)
+                        mods = ctxmod->get_mods ();
+               $$ = START_MAKE_SYNTAX ("context-specification", $2, $3, mods, SCM_BOOL_T);
+       }
+       ;
+
 composite_music:
-       complex_music
+       music_function_call
+       | repeated_music                { $$ = $1; }
+       | re_rhythmed_music     { $$ = $1; }
+       | context_prefix music
+       {
+               $$ = FINISH_MAKE_SYNTAX ($1, @$, $2);
+       }
        | music_bare
        ;
 
@@ -2138,33 +2161,6 @@ lyric_mode_music:
        | MUSIC_IDENTIFIER
        ;
 
-complex_music:
-       music_function_call
-       | repeated_music                { $$ = $1; }
-       | re_rhythmed_music     { $$ = $1; }
-       | complex_music_prefix music
-       {
-               $$ = FINISH_MAKE_SYNTAX ($1, @$, $2);
-       }
-       ;
-
-complex_music_prefix:
-       CONTEXT symbol optional_id optional_context_mod {
-                Context_mod *ctxmod = Context_mod::unsmob ($4);
-                SCM mods = SCM_EOL;
-                if (ctxmod)
-                        mods = ctxmod->get_mods ();
-               $$ = START_MAKE_SYNTAX ("context-specification", $2, $3, mods, SCM_BOOL_F);
-       }
-       | NEWCONTEXT symbol optional_id optional_context_mod {
-                Context_mod *ctxmod = Context_mod::unsmob ($4);
-                SCM mods = SCM_EOL;
-                if (ctxmod)
-                        mods = ctxmod->get_mods ();
-               $$ = START_MAKE_SYNTAX ("context-specification", $2, $3, mods, SCM_BOOL_T);
-       }
-       ;
-
 mode_changed_music:
        mode_changing_head grouped_music_list {
                if ($1 == ly_symbol2scm ("chords"))