diff options
author | Han-Wen Nienhuys <hanwen@xs4all.nl> | 2007-01-04 14:43:36 +0100 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@xs4all.nl> | 2007-01-04 14:43:36 +0100 |
commit | 6303342f277faaf90c183f868c3ff6b3bef98ae5 (patch) | |
tree | a1d73d7ce08c2d080bbfab15841aa00e0d843f50 | |
parent | afa98722d22b2cc4c98254ff05c9ee164cf98bae (diff) |
coverage fixes.
-rw-r--r-- | input/regression/general-scheme-bindings.ly | 6 | ||||
-rw-r--r-- | input/regression/identifiers.ly | 31 | ||||
-rw-r--r-- | input/regression/midi-microtone.ly | 10 | ||||
-rw-r--r-- | input/regression/multi-measure-rest-usebreve.ly | 24 | ||||
-rw-r--r-- | input/regression/multi-measure-rest.ly | 3 | ||||
-rw-r--r-- | lily/duration-scheme.cc | 8 | ||||
-rw-r--r-- | lily/lily-parser-scheme.cc | 16 | ||||
-rw-r--r-- | lily/multi-measure-rest.cc | 4 | ||||
-rw-r--r-- | lily/parser.yy | 2 |
9 files changed, 83 insertions, 21 deletions
diff --git a/input/regression/general-scheme-bindings.ly b/input/regression/general-scheme-bindings.ly index 677b270069..f4ebf049b3 100644 --- a/input/regression/general-scheme-bindings.ly +++ b/input/regression/general-scheme-bindings.ly @@ -7,4 +7,10 @@ \version "2.11.8" +%% todo : use macro, to show the statement tested. #(ly:progress "~a" (ly:expand-environment "${HOME} $HOME $$ ")) +#(ly:font-config-display-fonts) +#(ly:progress "~A" (ly:duration->string (ly:make-duration 2 2 3 7))) + + +#(ly:parser-parse-string (ly:parser-clone parser) "foo = #1 #(ly:progress \"hello there\n\")") diff --git a/input/regression/identifiers.ly b/input/regression/identifiers.ly new file mode 100644 index 0000000000..682a156204 --- /dev/null +++ b/input/regression/identifiers.ly @@ -0,0 +1,31 @@ + +\header { + texidoc = "test identifiers." + } +\version "2.10.8" + +num = #3 +mus = { c'4 } +paperId = \paper { line-width = 5.0 \cm } +layoutId = \layout { ragged-right = ##t } +perfId = \midi {} +markupId = \markup { hoi } +stringId = "title" + +% headers not allowed as Id's + +scoreId = \score { + \repeat unfold \num \mus + \layout { \layoutId } + \midi { \perfId } + } + +bookId = \book { + \score { \scoreId } + \paper { \paperId } + } + + +\book { \bookId } + + diff --git a/input/regression/midi-microtone.ly b/input/regression/midi-microtone.ly new file mode 100644 index 0000000000..cf1f9f1e32 --- /dev/null +++ b/input/regression/midi-microtone.ly @@ -0,0 +1,10 @@ +\version "2.10.8" +\header { + texidoc = "The pitch wheel is used for microtones." + } + +\score { + { c4 cih cis cisih d } + \midi { } + } + diff --git a/input/regression/multi-measure-rest-usebreve.ly b/input/regression/multi-measure-rest-usebreve.ly new file mode 100644 index 0000000000..444becef4d --- /dev/null +++ b/input/regression/multi-measure-rest-usebreve.ly @@ -0,0 +1,24 @@ +\version "2.10.0" +\header{ + + texidoc="For longer measure lengths, the breve rest is used." + +} + +\layout { + \context { + \Score + skipBars = ##t + } + ragged-right = ##t +} + + +{ + \time 8/4 + R1*12 + \time 4/4 + R1*6 +} + + diff --git a/input/regression/multi-measure-rest.ly b/input/regression/multi-measure-rest.ly index 5fb5344018..8ea6f3155c 100644 --- a/input/regression/multi-measure-rest.ly +++ b/input/regression/multi-measure-rest.ly @@ -27,8 +27,7 @@ are used then a different symbol is used. \time 3/4 \key cis \major R2.*15 - R2. - R2.*3 + R2.*7 R2.*9 R2.*11 diff --git a/lily/duration-scheme.cc b/lily/duration-scheme.cc index 361036256d..d10d8f2ee3 100644 --- a/lily/duration-scheme.cc +++ b/lily/duration-scheme.cc @@ -121,6 +121,14 @@ LY_DEFINE (ly_duration_length, "ly:duration-length", return Moment (unsmob_duration (dur)->get_length ()).smobbed_copy (); } +LY_DEFINE (ly_duration2string, "ly:duration->string", + 1, 0, 0, (SCM dur), + "Convert{dur} to string.") +{ + SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration"); + return ly_string2scm (unsmob_duration (dur)->to_string ()); +} + LY_DEFINE (ly_duration_factor, "ly:duration-factor", 1, 0, 0, (SCM dur), "Extract the compression factor from @var{dur}. Return as a pair.") diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index bb08e3c01b..cd46e9774b 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -147,22 +147,6 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", return SCM_UNSPECIFIED; } -LY_DEFINE (ly_parse_string, "ly:parse-string", - 1, 0, 0, (SCM ly_code), - "Parse the string LY_CODE. " - "Upon failure, throw @code{ly-file-failed} key.") -{ - SCM_ASSERT_TYPE (scm_is_string (ly_code), ly_code, SCM_ARG1, __FUNCTION__, "string"); - - Sources sources; - sources.set_path (&global_path); - Lily_parser *parser = new Lily_parser (&sources); - parser->parse_string (ly_scm2string (ly_code)); - parser->unprotect (); - parser = 0; - - return SCM_UNSPECIFIED; -} LY_DEFINE (ly_parser_lexer, "ly:parser-lexer", 1, 0, 0, (SCM parser_smob), diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 44d699b7ce..bc6f7927bc 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -205,11 +205,11 @@ Multi_measure_rest::church_rest (Grob *me, Font_metric *musfont, int measures, int count = 0; Real symbols_width = 0.0; - SCM sml = me->get_property ("use-breve-rest"); + bool use_breve = to_boolean (me->get_property ("use-breve-rest")); while (l) { - if (sml == SCM_BOOL_T) + if (use_breve) { int k; if (l >= 2) diff --git a/lily/parser.yy b/lily/parser.yy index 977f1a697f..0d42a60a18 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -503,7 +503,7 @@ embedded_scm: lilypond_header_body: { - $$ = get_header(PARSER); + $$ = get_header (PARSER); PARSER->lexer_->add_scope ($$); } | lilypond_header_body assignment { |