From 0bafa98ebd26f782c2e0355234ff1270df32b7d9 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 3 Jun 2004 21:50:37 +0000 Subject: [PATCH] * ly/nederlands.ly (pitchnames): use ly:parser-set-note-names. This fixes setting notenames with `\include "nederlands.ly" ' * lily/my-lily-parser.cc (LY_DEFINE): ly:parser-set-note-names: new function. --- ChangeLog | 8 ++++++++ lily/my-lily-parser.cc | 22 ++++++++++++++++++++++ ly/catalan.ly | 2 ++ ly/deutsch.ly | 2 ++ ly/english.ly | 2 ++ ly/espanol.ly | 2 ++ ly/italiano.ly | 2 ++ ly/nederlands.ly | 1 + ly/norsk.ly | 2 ++ ly/portugues.ly | 2 ++ ly/suomi.ly | 2 ++ ly/svenska.ly | 2 ++ 12 files changed, 49 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2391b6eee7..98fa4891f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-06-03 Han-Wen Nienhuys + + * ly/nederlands.ly (pitchnames): use ly:parser-set-note-names. + This fixes setting notenames with `\include "nederlands.ly" ' + + * lily/my-lily-parser.cc (LY_DEFINE): ly:parser-set-note-names: + new function. + 2004-06-01 Han-Wen Nienhuys * scm/page-layout.scm: don't do piece, it should be in score-title diff --git a/lily/my-lily-parser.cc b/lily/my-lily-parser.cc index d1a24e8e79..e98cd9a5d6 100644 --- a/lily/my-lily-parser.cc +++ b/lily/my-lily-parser.cc @@ -280,6 +280,8 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", progress_indication ("\n"); My_lily_parser *parser = new My_lily_parser (&sources); + + // TODO: use $parser scm_module_define (global_lily_module, ly_symbol2scm ("parser"), parser->self_scm ()); parser->parse_file (init, file_name, out_file); @@ -452,6 +454,25 @@ LY_DEFINE (ly_parser_print_score, "ly:parser-print-score", return SCM_UNDEFINED; } + +LY_DEFINE (ly_parser_set_names, "ly:parser-set-note-names", + 2, 0, 0, + (SCM parser, SCM names), + "Replace current note names in @var{parser}. @var{names} is an alist of " + "symbols. This only has effect if the current mode is notes.") +{ + My_lily_parser *p = unsmob_my_lily_parser (parser); + SCM_ASSERT_TYPE(p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser"); + + if (p->lexer_->is_note_state ()) + { + p->lexer_->pop_state (); + p->lexer_->push_note_state (alist_to_hashq (names)); + } + + return SCM_UNSPECIFIED; +} + LY_DEFINE (ly_parser_print_book, "ly:parser-print-book", 2, 0, 0, (SCM parser_smob, SCM book_smob), @@ -484,3 +505,4 @@ LY_DEFINE (ly_parser_print_book, "ly:parser-print-book", return SCM_UNDEFINED; } + diff --git a/ly/catalan.ly b/ly/catalan.ly index eddc835d7d..f042504564 100644 --- a/ly/catalan.ly +++ b/ly/catalan.ly @@ -74,3 +74,5 @@ pitchnamesCatalan = #`( pitchnames = \pitchnamesCatalan \version "2.2.0" + +#(ly:parser-set-note-names parser pitchnames) diff --git a/ly/deutsch.ly b/ly/deutsch.ly index 0d8918ef46..d58a6267b8 100644 --- a/ly/deutsch.ly +++ b/ly/deutsch.ly @@ -50,3 +50,5 @@ pitchnamesDeutsch = #`( pitchnames = \pitchnamesDeutsch \version "2.2.0" + +#(ly:parser-set-note-names parser pitchnames) diff --git a/ly/english.ly b/ly/english.ly index 2219f03f75..5c35e15315 100644 --- a/ly/english.ly +++ b/ly/english.ly @@ -89,3 +89,5 @@ pitchnames = \pitchnamesEnglish \version "2.2.0" + +#(ly:parser-set-note-names parser pitchnames) diff --git a/ly/espanol.ly b/ly/espanol.ly index ae8ce9447f..6fe014bcb5 100644 --- a/ly/espanol.ly +++ b/ly/espanol.ly @@ -59,3 +59,5 @@ pitchnamesEspanol = #`( pitchnames = \pitchnamesEspanol \version "2.2.0" + +#(ly:parser-set-note-names parser pitchnames) diff --git a/ly/italiano.ly b/ly/italiano.ly index 23d3d05878..d0e0750456 100644 --- a/ly/italiano.ly +++ b/ly/italiano.ly @@ -87,3 +87,5 @@ pitchnamesItaliano = #`( pitchnames = \pitchnamesItaliano \version "2.2.0" + +#(ly:parser-set-note-names parser pitchnames) diff --git a/ly/nederlands.ly b/ly/nederlands.ly index 816c3040fb..f41e204c84 100644 --- a/ly/nederlands.ly +++ b/ly/nederlands.ly @@ -85,3 +85,4 @@ dutchPitchnames = #`( pitchnames = \dutchPitchnames +#(ly:parser-set-note-names parser pitchnames) diff --git a/ly/norsk.ly b/ly/norsk.ly index dc51587374..5c68698988 100644 --- a/ly/norsk.ly +++ b/ly/norsk.ly @@ -106,3 +106,5 @@ pitchnamesNorsk = #`( pitchnames =\pitchnamesNorsk \version "2.2.0" + +#(ly:parser-set-note-names parser pitchnames) diff --git a/ly/portugues.ly b/ly/portugues.ly index 616459d7f4..a246f66380 100644 --- a/ly/portugues.ly +++ b/ly/portugues.ly @@ -87,3 +87,5 @@ pitchnamesPortuguese = #`( pitchnames = \pitchnamesPortuguese \version "2.2.0" + +#(ly:parser-set-note-names parser pitchnames) diff --git a/ly/suomi.ly b/ly/suomi.ly index ba828d3bcd..21b0dab45f 100644 --- a/ly/suomi.ly +++ b/ly/suomi.ly @@ -49,3 +49,5 @@ pitchnamesSuomi = #`( pitchnames = \pitchnamesSuomi \version "2.2.0" + +#(ly:parser-set-note-names parser pitchnames) diff --git a/ly/svenska.ly b/ly/svenska.ly index 2c96ac2b4b..38905bd4cc 100644 --- a/ly/svenska.ly +++ b/ly/svenska.ly @@ -43,3 +43,5 @@ pitchnamesSvenska = #`( pitchnames = \pitchnamesSvenska \version "2.2.0" + +#(ly:parser-set-note-names parser pitchnames) -- 2.39.5