From: Han-Wen Nienhuys Date: Fri, 16 Dec 2005 00:44:49 +0000 (+0000) Subject: * ly/music-functions-init.ly: add \bar and \clef music function X-Git-Tag: release/2.7.24~19 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=12abdc76c2764d9823f842f44bacf7401cf931d4;p=lilypond.git * ly/music-functions-init.ly: add \bar and \clef music function * lily/lily-lexer.cc: idem. * lily/parser.yy (FIXME): remove BAR and CLEF. --- diff --git a/ChangeLog b/ChangeLog index ec8f125862..2334dc5f68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-12-16 Han-Wen Nienhuys + + * 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 * Documentation/topdocs/NEWS.tely (Top): doc string argument change. diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index 03ba282520..fb3fdba8b8 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -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}, diff --git a/lily/parser.yy b/lily/parser.yy index 0c3810cb67..81a8f81082 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -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"); diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index 0d7aeb26c0..90a6d8edb7 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -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 - * ? - -%} -