]> git.donarmstrong.com Git - lilypond.git/commitdiff
* ly/music-functions-init.ly: add \bar and \clef music function
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 16 Dec 2005 00:44:49 +0000 (00:44 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 16 Dec 2005 00:44:49 +0000 (00:44 +0000)
* lily/lily-lexer.cc: idem.

* lily/parser.yy (FIXME): remove BAR and CLEF.

ChangeLog
lily/lily-lexer.cc
lily/parser.yy
ly/music-functions-init.ly

index ec8f1258627f9129799595de7a2b4197b03d55c9..2334dc5f689e72db5f8fc23cb4270930e82077d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-12-16  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * ly/music-functions-init.ly: add \bar and \clef music function 
+
+       * lily/lily-lexer.cc: idem.
+
+       * lily/parser.yy (FIXME): remove BAR and CLEF.
+
 2005-12-14  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * Documentation/topdocs/NEWS.tely (Top): doc string argument change.
index 03ba2825205eaac51ed4ec4835c4b3b8026c4bb6..fb3fdba8b87446a8a3c96cb8f253225741f9f51e 100644 (file)
@@ -28,12 +28,10 @@ static Keyword_ent the_key_tab[]
   {"addquote", ADDQUOTE},
   {"alias", ALIAS},
   {"alternative", ALTERNATIVE},
-  {"bar", BAR},
   {"book", BOOK},
   {"change", CHANGE},
   {"chordmode", CHORDMODE},
   {"chords", CHORDS},
-  {"clef", CLEF},
   {"consists", CONSISTS},
   {"context", CONTEXT},
   {"default", DEFAULT},
index 0c3810cb67d64181b43f9dabb13dc857dc084c26..81a8f810828fac52dbc474de935d50147922a2f3 100644 (file)
@@ -154,12 +154,10 @@ void set_music_properties (Music *p, SCM a);
 %token ADDQUOTE "\\addquote"
 %token ALIAS "\\alias"
 %token ALTERNATIVE "\\alternative"
-%token BAR "\\bar"
 %token BOOK "\book"
 %token CHANGE "\\change"
 %token CHORDMODE "\\chordmode"
 %token CHORDS "\\chords"
-%token CLEF "\\clef"
 %token CONSISTS "\\consists"
 %token CONTEXT "\\context"
 %token DEFAULT "\\default"
@@ -1636,15 +1634,6 @@ command_element:
                $$ = context_spec_music (ly_symbol2scm ("Staff"), SCM_UNDEFINED,
                        $$, SCM_EOL);
        }
-       | BAR STRING                    {
-               Music *t = set_property_music (ly_symbol2scm ("whichBar"), $2);
-
-               Music *csm = context_spec_music (ly_symbol2scm ("Timing"), SCM_UNDEFINED,
-                                       t, SCM_EOL);
-               $$ = context_spec_music (ly_symbol2scm ("Score"), SCM_UNDEFINED, csm, SCM_EOL);
-               $$->set_spot (@$);
-               t->set_spot (@$);
-       }
        | PARTIAL duration_length       {
                Moment m = - unsmob_duration ($2)->get_length ();
                Music *p = set_property_music (ly_symbol2scm ( "measurePosition"),m.smobbed_copy ());
@@ -1655,13 +1644,7 @@ command_element:
                                        p, SCM_EOL);
                $$ = p;
        }
-       | CLEF STRING  {
-               SCM proc = ly_lily_module_constant ("make-clef-set");
 
-               SCM result = scm_call_1 (proc, $2);
-               $$ = unsmob_music (result);
-               $$->protect ();
-       }
        | TIME_T fraction  {
                SCM proc = ly_lily_module_constant ("make-time-signature-set");
 
index 0d7aeb26c0e81a222b0c17c15648280380d756c3..90a6d8edb76c330a262a49903c9a7829dc28b498 100644 (file)
@@ -43,6 +43,21 @@ tag = #(def-music-function (parser location tag arg)
          (ly:music-property arg 'tags)))
    arg)
 
+clef =
+#(def-music-function (parser location type)
+   (string?)
+   
+   "Set the current clef."
+
+   (make-clef-set type))
+
+bar =
+#(def-music-function (parser location type)
+   (string?)
+   (context-spec-music
+    (make-property-set 'whichBar type)
+    'Timing))
+
 applyMusic =
 #(def-music-function (parser location func music) (procedure? ly:music?)
                (func music))
@@ -311,18 +326,3 @@ assertBeamSlope =
 
 
 
-%{
-
-TODO:
-
-remove these from the parser, and softcode here:
-
- * \tag
-
-with small syntax changes, we could also do
-
- * \bar
- *  ?
-
-%}
-