Permalink
Browse files

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

  • Loading branch information...
1 parent 89dd07d commit fb0b7d2fa495e927fcf24fd99c9bfbf802b8a182 @LastOfTheCarelessMen committed Jan 16, 2010
Showing with 13 additions and 1 deletion.
  1. +7 −1 lib/ABC.pm
  2. +6 −0 t/01-regexes.t
View
@@ -19,7 +19,13 @@ grammar ABC
regex rest_type { <[x..z]> }
regex rest { <rest_type> <note_length>? }
- regex gracing { '+' <alpha>+ '+' }
+ regex grace_note { <pitch> <note_length>? } # as note, but without tie
+ regex grace_note_stem { <grace_note> | [ '[' <grace_note>+ ']' ] }
+ regex acciaccatura { '/' }
+ regex grace_notes { '{' <acciaccatura>? <grace_note_stem>+ '}' }
+
+ regex long_gracing { '+' <alpha>+ '+' }
+ regex gracing { '.' | '~' | <long_gracing> }
regex spacing { \h+ }
View
@@ -91,6 +91,12 @@ plan *;
}
{
+ my $match = "~" ~~ m/ <ABC::element> /;
+ isa_ok $match, Match, '"~" is an element';
+ is $match<ABC::element><gracing>, "~", '"~" gracing is ~';
+}
+
+{
my $match = "z/" ~~ m/ <ABC::element> /;
isa_ok $match, Match, '"z/" is an element';
is $match<ABC::element><rest><rest_type>, "z", '"z/" has base rest z';

0 comments on commit fb0b7d2

Please sign in to comment.