]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/parser.yy
parser: change order of arguments for context-specification constructor
[lilypond.git] / lily / parser.yy
index b0a584ff91e93fd71465659a7d181c7321093bce..f6baa9986889d1d1db835e233bc5c45db81a404b 100644 (file)
@@ -141,7 +141,7 @@ using namespace std;
   scm_apply_0 (proc, args)
 /* Syntactic Sugar. */
 #define MAKE_SYNTAX(name, location, ...)       \
-  LOWLEVEL_MAKE_SYNTAX (ly_lily_module_constant (name), scm_list_n (PARSER->self_scm (), make_input (location), __VA_ARGS__, SCM_UNDEFINED));
+  LOWLEVEL_MAKE_SYNTAX (ly_lily_module_constant (name), scm_list_n (PARSER->self_scm (), make_input (location), ##__VA_ARGS__, SCM_UNDEFINED));
 
 SCM get_next_unique_context_id ();
 SCM get_next_unique_lyrics_context_id ();
@@ -156,7 +156,6 @@ SCM get_next_unique_lyrics_context_id ();
 
 
 static Music *make_music_with_input (SCM name, Input where);
-SCM run_music_function (Lily_parser *parser, Input loc, SCM func, SCM args);
 SCM check_scheme_arg (Lily_parser *parser, Input loc, SCM fallback,
                      SCM arg, SCM args, SCM pred);
 SCM loc_on_music (Input loc, SCM arg);
@@ -578,13 +577,16 @@ embedded_scm:
 
 scm_function_call:
        SCM_FUNCTION function_arglist {
-               $$ = run_music_function (PARSER, @$,
+               $$ = MAKE_SYNTAX ("music-function", @$,
                                         $1, $2);
        }
        ;
 
 embedded_lilypond:
-       { $$ = MAKE_SYNTAX ("void-music", @$, SCM_UNDEFINED); }
+       /* empty */
+       {
+               $$ = MAKE_SYNTAX ("void-music", @$);
+       }
        | identifier_init
        | music music music_list {
                $$ = MAKE_SYNTAX ("sequential-music", @$,       
@@ -1263,7 +1265,7 @@ embedded_scm_closed:
 
 scm_function_call_closed:
        SCM_FUNCTION function_arglist_closed {
-               $$ = run_music_function (PARSER, @$,
+               $$ = MAKE_SYNTAX ("music-function", @$,
                                         $1, $2);
        }
        ;
@@ -1291,7 +1293,7 @@ function_arglist_bare:
 
 music_function_call:
        MUSIC_FUNCTION function_arglist {
-               $$ = run_music_function (PARSER, @$,
+               $$ = MAKE_SYNTAX ("music-function", @$,
                                         $1, $2);
        }
        ;
@@ -1311,14 +1313,14 @@ complex_music:
                 SCM mods = SCM_EOL;
                 if (ctxmod)
                         mods = ctxmod->get_mods ();
-               $$ = MAKE_SYNTAX ("context-specification", @$, $2, $3, $5, mods, SCM_BOOL_F);
+               $$ = MAKE_SYNTAX ("context-specification", @$, $2, $3, mods, SCM_BOOL_F, $5);
        }
        | NEWCONTEXT simple_string optional_id optional_context_mod music {
                 Context_mod *ctxmod = unsmob_context_mod ($4);
                 SCM mods = SCM_EOL;
                 if (ctxmod)
                         mods = ctxmod->get_mods ();
-               $$ = MAKE_SYNTAX ("context-specification", @$, $2, $3, $5, mods, SCM_BOOL_T);
+               $$ = MAKE_SYNTAX ("context-specification", @$, $2, $3, mods, SCM_BOOL_T, $5);
        }
 
        | TIMES fraction music {
@@ -1345,7 +1347,7 @@ mode_changed_music:
                 SCM mods = SCM_EOL;
                 if (ctxmod)
                         mods = ctxmod->get_mods ();
-               $$ = MAKE_SYNTAX ("context-specification", @$, $1, SCM_EOL, $3, mods, SCM_BOOL_T);
+               $$ = MAKE_SYNTAX ("context-specification", @$, $1, SCM_EOL, mods, SCM_BOOL_T, $3);
                if ($1 == ly_symbol2scm ("ChordNames"))
                {
                  $$ = MAKE_SYNTAX ("unrelativable-music", @$, $$);
@@ -1752,14 +1754,14 @@ music_function_chord_body_arglist:
 embedded_scm_chord_body:
        embedded_scm_bare
        | SCM_FUNCTION music_function_chord_body_arglist {
-               $$ = run_music_function (PARSER, @$,
+               $$ = MAKE_SYNTAX ("music-function", @$,
                                         $1, $2);
        }
        ;
 
 music_function_chord_body:
        MUSIC_FUNCTION music_function_chord_body_arglist {
-               $$ = run_music_function (PARSER, @$,
+               $$ = MAKE_SYNTAX ("music-function", @$,
                                         $1, $2);
        }
        ;
@@ -1782,21 +1784,21 @@ music_function_event_arglist:
 embedded_scm_event:
        embedded_scm_bare
        | SCM_FUNCTION music_function_event_arglist {
-               $$ = run_music_function (PARSER, @$,
+               $$ = MAKE_SYNTAX ("music-function", @$,
                                         $1, $2);
        }
        ;
 
 music_function_event:
        MUSIC_FUNCTION music_function_event_arglist {
-               $$ = run_music_function (PARSER, @$,
+               $$ = MAKE_SYNTAX ("music-function", @$,
                                         $1, $2);
        }
        ;
 
 event_function_event:
        EVENT_FUNCTION music_function_event_arglist {
-               $$ = run_music_function (PARSER, @$,
+               $$ = MAKE_SYNTAX ("music-function", @$,
                                         $1, $2);
        }
        ;
@@ -1816,7 +1818,7 @@ command_element:
                $$ = m->unprotect ();
        }
        | E_BACKSLASH {
-               $$ = MAKE_SYNTAX ("voice-separator", @$, SCM_UNDEFINED);
+               $$ = MAKE_SYNTAX ("voice-separator", @$);
        }
        | '|'      {
                SCM pipe = PARSER->lexer_->lookup_identifier ("pipeSymbol");
@@ -1829,7 +1831,7 @@ command_element:
                        $$ = m->unprotect ();
                }
                else
-                       $$ = MAKE_SYNTAX ("bar-check", @$, SCM_UNDEFINED);
+                       $$ = MAKE_SYNTAX ("bar-check", @$);
 
        }
        | TIME_T fraction  {
@@ -2847,26 +2849,6 @@ get_next_unique_lyrics_context_id ()
 }
 
 
-SCM
-run_music_function (Lily_parser *parser, Input loc, SCM func, SCM args)
-{
-       SCM sig = scm_object_property (func, ly_symbol2scm ("music-function-signature"));
-
-       args = scm_reverse_x (args, SCM_EOL);
-
-       SCM fallback = SCM_BOOL_F;
-       SCM pred = scm_car (sig);
-
-       if (scm_is_pair (pred))
-       {
-               fallback = loc_on_music (loc, scm_cdr (pred));
-               pred = scm_car (pred);
-       }
-
-       SCM syntax_args = scm_list_n (parser->self_scm (), make_input (loc), pred, fallback, func, args, SCM_UNDEFINED);
-       return LOWLEVEL_MAKE_SYNTAX (ly_lily_module_constant ("music-function"), syntax_args);
-}
-
 SCM check_scheme_arg (Lily_parser *parser, Input loc, SCM fallback,
                      SCM arg, SCM args, SCM pred)
 {