From: Neil Puttock <n.puttock@gmail.com>
Date: Mon, 5 Apr 2010 21:40:53 +0000 (+0100)
Subject: Don't discard compression factor for duration identifiers.
X-Git-Tag: release/2.13.18-1~18^2~1^2~5
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f47c35136bfb2704a35521883a14936a91193220;p=lilypond.git

Don't discard compression factor for duration identifiers.

* lily/parser.yy:

  retrieve duration factor from duration identifier and apply it to
  copied duration

* input/regression (new file):

  add regtest
---

diff --git a/input/regression/duration-identifier-compressed.ly b/input/regression/duration-identifier-compressed.ly
new file mode 100644
index 0000000000..2f8cc5a7d9
--- /dev/null
+++ b/input/regression/duration-identifier-compressed.ly
@@ -0,0 +1,15 @@
+\version "2.13.18"
+
+\header {
+  texidoc = "The compression factor of a duration identifier is
+correctly accounted for by the parser."
+}
+
+% looks like a whole note, has duration of half note
+wholeHalved = #(ly:make-duration 0 0 1 2)
+
+
+\displayMusic \relative c' {
+  c\wholeHalved c |
+  c\wholeHalved. c4 |
+}
diff --git a/lily/parser.yy b/lily/parser.yy
index 1ec5e11aa2..41e5080f98 100644
--- a/lily/parser.yy
+++ b/lily/parser.yy
@@ -1990,6 +1990,7 @@ steno_duration:
 	| DURATION_IDENTIFIER dots	{
 		Duration *d = unsmob_duration ($1);
 		Duration k (d->duration_log (), d->dot_count () + $2);
+		k = k.compressed (d->factor ());
 		*d = k;
 		$$ = $1;
 	}