Permalink
Browse files

Be smarter about extraneous end-slur marks. (To deal with Gerry Stron…

…g's (3abc) triplets.)
  • Loading branch information...
1 parent 18bb13f commit 41c04b46f638dd94fb17456482bc163508ba6788 @colomon committed May 6, 2012
Showing with 9 additions and 1 deletion.
  1. +5 −1 bin/abc2ly.pl
  2. +4 −0 lib/ABC/Actions.pm
View
@@ -193,6 +193,7 @@ (ABC::Header $header, $out)
my $duration = 0;
my $chord-duration = 0;
my $suffix = "";
+ my $in-slur = False;
for @elements -> $element {
$duration += self.Duration($element);
$chord-duration += self.Duration($element);
@@ -264,9 +265,12 @@ (ABC::Header $header, $out)
}
when "slur_begin" {
$suffix ~= "(";
+ $in-slur = True;
}
when "slur_end" {
- $lilypond .= subst(/(\s+)$/, { ")$_" });
+ $lilypond .= subst(/(\s+)$/, { ")$_" }) if $in-slur;
+ $*ERR.say: "Warning: End-slur found without begin-slur" unless $in-slur;
+ $in-slur = False;
}
when "multi_measure_rest" {
$lilypond ~= "\\compressFullBarRests R"
View
@@ -13,6 +13,10 @@ use ABC::GraceNotes;
class ABC::Actions {
method header_field($/) {
+ if $<header_field_name> eq "T" {
+ $*ERR.say: "Parsing " ~ $<header_field_data>;
+ }
+
make ~$<header_field_name> => ~$<header_field_data>;
}

0 comments on commit 41c04b4

Please sign in to comment.