]> git.donarmstrong.com Git - lilypond.git/commitdiff
parser.yy et al: make \mark a musicfunction.
authorDavid Kastrup <dak@gnu.org>
Sat, 29 Oct 2011 18:26:32 +0000 (20:26 +0200)
committerDavid Kastrup <dak@gnu.org>
Tue, 8 Nov 2011 21:56:53 +0000 (22:56 +0100)
lily/lily-lexer.cc
lily/parser.yy
ly/music-functions-init.ly
scm/ly-syntax-constructors.scm

index 4a0ef0eb167dd3c6a47b6dc99bf0a12d15a0c4d5..be76d90bd75f7cd2b6c886062708c4e6d6d7f0d5 100644 (file)
@@ -64,7 +64,6 @@ static Keyword_ent the_key_tab[]
   {"lyricmode", LYRICMODE},
   {"lyrics", LYRICS},
   {"lyricsto", LYRICSTO},
-  {"mark", MARK},
   {"markup", MARKUP},
   {"markuplist", MARKUPLIST},
   {"midi", MIDI},
index f7e938d5f32fb286fe4deba89ec2bc65bc8f4e84..fbb65f106d3ab934fc0d2ea27e0cdbd61f881410 100644 (file)
@@ -240,7 +240,6 @@ void set_music_properties (Music *p, SCM a);
 %token LYRICMODE "\\lyricmode"
 %token LYRICS "\\lyrics"
 %token LYRICSTO "\\lyricsto"
-%token MARK "\\mark"
 %token MARKUP "\\markup"
 %token MARKUPLIST "\\markuplist"
 %token MIDI "\\midi"
@@ -1994,19 +1993,12 @@ command_element:
                        $$ = MAKE_SYNTAX ("bar-check", @$);
 
        }
-       | MARK scalar {
-               $$ = MAKE_SYNTAX ("make-mark-set", @$, $2);
-       }
        ;
 
 command_event:
        E_TILDE {
                $$ = MY_MAKE_MUSIC ("PesOrFlexaEvent", @$)->unprotect ();
        }
-       | MARK DEFAULT  {
-               Music *m = MY_MAKE_MUSIC ("MarkEvent", @$);
-               $$ = m->unprotect ();
-       }
        | tempo_event {
                $$ = $1;
        }
index 84eabb3b5c724fb319831ef4124521aff477160c..a3bfebec820dee26207e64a204a7dd79217397bf 100644 (file)
@@ -560,6 +560,22 @@ inversion =
 transpose from @var{around} to @var{to}.")
    (music-invert around to music))
 
+mark =
+#(define-music-function
+   (parser location label) ((scheme? '()))
+  "Make the music for the \\mark command."
+  (let* ((set (and (integer? label)
+                  (context-spec-music (make-property-set 'rehearsalMark label)
+                                     'Score)))
+        (ev (make-music 'MarkEvent
+                        'origin location)))
+
+    (if set
+       (make-sequential-music (list set ev))
+       (begin
+         (set! (ly:music-property ev 'label) label)
+         ev))))
+
 musicMap =
 #(define-music-function (parser location proc mus) (procedure? ly:music?)
    (_i "Apply @var{proc} to @var{mus} and all of the music it contains.")
index ebc40267afe25c83dbfd947bee8855ec853a9b9c..dbb466b9a013967eb6d6238436f4fb8676cbe93a 100644 (file)
@@ -246,17 +246,3 @@ into a @code{MultiMeasureTextEvent}."
                                         'origin loc)))
                         addlyrics-list)))
     (make-simultaneous-music (cons voice lyricstos))))
-
-(define-ly-syntax (make-mark-set parser location label)
-  "Make the music for the \\mark command."
-  (let* ((set (and (integer? label)
-                  (context-spec-music (make-property-set 'rehearsalMark label)
-                                     'Score)))
-        (ev (make-music 'MarkEvent
-                        'origin location)))
-
-    (if set
-       (make-sequential-music (list set ev))
-       (begin
-         (set! (ly:music-property ev 'label) label)
-         ev))))