+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.
{"addquote", ADDQUOTE},
{"alias", ALIAS},
{"alternative", ALTERNATIVE},
- {"bar", BAR},
{"book", BOOK},
{"change", CHANGE},
{"chordmode", CHORDMODE},
{"chords", CHORDS},
- {"clef", CLEF},
{"consists", CONSISTS},
{"context", CONTEXT},
{"default", DEFAULT},
%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"
$$ = 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 ());
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");
(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))
-%{
-
-TODO:
-
-remove these from the parser, and softcode here:
-
- * \tag
-
-with small syntax changes, we could also do
-
- * \bar
- * ?
-
-%}
-