+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);
+ }
+ ;
+
+new_lyrics:
+ ADDLYRICS lyric_mode_music {
+ $$ = scm_list_1 ($2);
+ }
+ | new_lyrics ADDLYRICS lyric_mode_music {
+ $$ = scm_cons ($3, $1);
+ }
+ ;
+
+/* basic_music is basically the same as composite_music but with
+ * context-prefixed music and lyricized music explicitly removed. The
+ * reason is that in a sequence
+ *
+ * \new Staff \new Voice { ... } \addlyrics { ... } \addlyrics { ... }
+ *
+ * we need to group both \addlyrics together (as they go with the same
+ * voice) but then combine them with \new Voice { ... }, meaning that
+ * combining \new Voice { ... } needs higher priority than
+ * { ... } \addlyrics, and *not* have \new Staff \new Voice { ... }
+ * combine before combining \new Voice { ... } \addlyrics: only one
+ * layer of context-prefixed music should assemble before \addlyrics
+ * is integrated. Total mess, and we sort this mess out with explicit
+ * rules preferring a single context-prefix.
+ */
+
+basic_music:
+ music_function_call
+ | repeated_music