Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Stringify grace notes, too.

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

0 notes on commit 8723201

Please sign in to comment.
Something went wrong with that request. Please try again.