Permalink
Browse files

Stringify grace notes, too.

  • Loading branch information...
colomon committed May 26, 2012
1 parent c32d681 commit 8723201ca8807f3708c5d528fcb88473f547507c
Showing with 6 additions and 0 deletions.
  1. +4 −0 lib/ABC/GraceNotes.pm
  2. +2 −0 t/07-stringify.t
View
@@ -8,4 +8,8 @@ class ABC::GraceNotes {
die "GraceNotes must have at least one note" if +@notes == 0;
self.bless(*, :$acciaccatura, :@notes);
}
+
+ method Str() {
+ '{' ~ ($.acciaccatura ?? '/' !! '') ~ @.notes.join('') ~ '}';
+ }
}
View
@@ -15,9 +15,11 @@ use ABC::GraceNotes;
use ABC::Actions;
my @simple-cases = ("a", "B,", "c'''", "^D2-", "_E,,/", "^^f/4", "=G3",
+ "z3", "y/3", "x", "Z10",
"[ceg]", "[D3/2d3/2]", "[A,2F2]",
"(3abc", "(5A/B/C/D/E/",
"a>b", "^c/4<B,,/4",
+ '{cdc}', '{/d}',
"(", ")");
for @simple-cases -> $test-case {

0 comments on commit 8723201

Please sign in to comment.