From 0188d5f61f2ca269fb61f728b97f2eaeb5647c34 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 02:05:52 +0000 Subject: [PATCH] lilypond-1.5.34 --- lily/my-lily-lexer.cc | 1 + lily/parser.yy | 26 +++++++++++++++++++------- lily/translator-group.cc | 10 ++++++++-- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index 658b052771..767ebf54a2 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -69,6 +69,7 @@ static Keyword_ent the_key_tab[]={ {"outputproperty", OUTPUTPROPERTY}, {"override", OVERRIDE}, {"set", SET}, + {"rest", REST}, {"revert", REVERT}, {"partial", PARTIAL}, {"paper", PAPER}, diff --git a/lily/parser.yy b/lily/parser.yy index 4f39421694..88e09abb57 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -239,13 +239,14 @@ yylex (YYSTYPE *s, void * v_l) %token TYPE %token UNSET %token CONTEXT +%token REST /* escaped */ %token E_CHAR E_EXCLAMATION E_SMALLER E_BIGGER E_OPEN E_CLOSE E_TILDE %token E_BACKSLASH %token CHORD_BASS CHORD_COLON CHORD_MINUS CHORD_CARET -%type exclamations questions dots +%type exclamations questions dots optional_rest %type bass_number bass_mod %type bass_figure figure_list figure_spec %token DIGIT @@ -1034,7 +1035,7 @@ property_def: Music *t = new Music (SCM_EOL); t->set_mus_property ("iterator-ctor", Push_property_iterator::constructor_cxx_function); - t->set_mus_property ("symbols", scm_string_to_symbol ($4)); + t->set_mus_property ("symbol", scm_string_to_symbol ($4)); t->set_mus_property ("pop-first", SCM_BOOL_T); t->set_mus_property ("grob-property", $6); t->set_mus_property ("grob-value", $8); @@ -1050,7 +1051,7 @@ property_def: Music *t = new Music (SCM_EOL); t->set_mus_property ("iterator-ctor", Push_property_iterator::constructor_cxx_function); - t->set_mus_property ("symbols", scm_string_to_symbol ($4)); + t->set_mus_property ("symbol", scm_string_to_symbol ($4)); t->set_mus_property ("grob-property", $6); t->set_mus_property ("grob-value", $8); Context_specced_music *csm = new Context_specced_music (SCM_EOL); @@ -1066,7 +1067,7 @@ property_def: Music *t = new Music (SCM_EOL); t->set_mus_property ("iterator-ctor", Pop_property_iterator::constructor_cxx_function); - t->set_mus_property ("symbols", scm_string_to_symbol ($4)); + t->set_mus_property ("symbol", scm_string_to_symbol ($4)); t->set_mus_property ("grob-property", $6); Context_specced_music *csm = new Context_specced_music (SCM_EOL); @@ -1750,18 +1751,29 @@ figure_spec: } ; + +optional_rest: + /**/ { $$ = 0; } + | REST { $$ = 1; } + ; + simple_element: - pitch exclamations questions optional_notemode_duration { + pitch exclamations questions optional_notemode_duration optional_rest { Input i = THIS->pop_spot (); if (!THIS->lexer_p_->note_state_b ()) THIS->parser_error (_ ("Have to be in Note mode for notes")); - Note_req *n = new Note_req; + Music *n = 0; + if ($5) + n = new Rest_req ; + else + n = new Note_req; n->set_mus_property ("pitch", $1); n->set_mus_property ("duration", $4); + if ($3 % 2) n->set_mus_property ("cautionary", SCM_BOOL_T); if ($2 % 2 || $3 % 2) @@ -1769,7 +1781,7 @@ simple_element: Simultaneous_music*v = new Request_chord (SCM_EOL); v->set_mus_property ("elements", scm_list_n (n->self_scm (), SCM_UNDEFINED)); - + v->set_spot (i); n->set_spot (i); $$ = v; diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 90e0c70acc..48384af09f 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -13,6 +13,7 @@ #include "moment.hh" #include "scm-hash.hh" #include "translator-def.hh" +#include "main.hh" Translator_group::Translator_group (Translator_group const&s) : Translator (s) @@ -300,10 +301,14 @@ Translator_group::internal_get_property (SCM sym) const return val; } - void Translator_group::internal_set_property (SCM sym, SCM val) { +#ifndef NDEBUG + if (internal_type_checking_global_b) + assert (type_check_assignment (sym, val, ly_symbol2scm ("backend-type?"))); +#endif + properties_dict ()->set (sym, val); } @@ -332,7 +337,7 @@ Translator_group::execute_single_pushpop_property (SCM prop, SCM eltprop, SCM va if (gh_pair_p (prev) || prev == SCM_EOL) { - bool ok = type_check_assignment (val, eltprop, ly_symbol2scm ("backend-type?")); + bool ok = type_check_assignment (eltprop, val, ly_symbol2scm ("backend-type?")); if (ok) { @@ -442,3 +447,4 @@ add_trans_scm_funcs () } ADD_SCM_INIT_FUNC (trans_scm, add_trans_scm_funcs); + -- 2.39.5