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 ();
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);
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", @$,
scm_function_call_closed:
SCM_FUNCTION function_arglist_closed {
- $$ = run_music_function (PARSER, @$,
+ $$ = MAKE_SYNTAX ("music-function", @$,
$1, $2);
}
;
music_function_call:
MUSIC_FUNCTION function_arglist {
- $$ = run_music_function (PARSER, @$,
+ $$ = MAKE_SYNTAX ("music-function", @$,
$1, $2);
}
;
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 {
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", @$, $$);
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);
}
;
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);
}
;
$$ = m->unprotect ();
}
| E_BACKSLASH {
- $$ = MAKE_SYNTAX ("voice-separator", @$, SCM_UNDEFINED);
+ $$ = MAKE_SYNTAX ("voice-separator", @$);
}
| '|' {
SCM pipe = PARSER->lexer_->lookup_identifier ("pipeSymbol");
$$ = m->unprotect ();
}
else
- $$ = MAKE_SYNTAX ("bar-check", @$, SCM_UNDEFINED);
+ $$ = MAKE_SYNTAX ("bar-check", @$);
}
| TIME_T fraction {
}
-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)
{