Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add staccato and roll gracings, and basic grace note support.

  • Loading branch information...
commit fb0b7d2fa495e927fcf24fd99c9bfbf802b8a182 1 parent 89dd07d
LastOfTheCarelessMen authored January 16, 2010
8  lib/ABC.pm
@@ -19,7 +19,13 @@ grammar ABC
19 19
     regex rest_type { <[x..z]> }
20 20
     regex rest { <rest_type> <note_length>? }
21 21
     
22  
-    regex gracing { '+' <alpha>+ '+' }
  22
+    regex grace_note { <pitch> <note_length>? } # as note, but without tie
  23
+    regex grace_note_stem { <grace_note> | [ '[' <grace_note>+ ']' ]  }
  24
+    regex acciaccatura { '/' }
  25
+    regex grace_notes { '{' <acciaccatura>? <grace_note_stem>+ '}' }
  26
+    
  27
+    regex long_gracing { '+' <alpha>+ '+' }
  28
+    regex gracing { '.' | '~' | <long_gracing> }
23 29
     
24 30
     regex spacing { \h+ }
25 31
     
6  t/01-regexes.t
@@ -91,6 +91,12 @@ plan *;
91 91
 }
92 92
 
93 93
 {
  94
+    my $match = "~" ~~ m/ <ABC::element> /;
  95
+    isa_ok $match, Match, '"~" is an element';
  96
+    is $match<ABC::element><gracing>, "~", '"~" gracing is ~';
  97
+}
  98
+
  99
+{
94 100
     my $match = "z/" ~~ m/ <ABC::element> /;
95 101
     isa_ok $match, Match, '"z/" is an element';
96 102
     is $match<ABC::element><rest><rest_type>, "z", '"z/" has base rest z';

0 notes on commit fb0b7d2

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