diff --git a/dg-check.pl b/dg-check.pl index 2ee7b01..9078f45 100644 --- a/dg-check.pl +++ b/dg-check.pl @@ -3,31 +3,26 @@ BEGIN { push @*INC, "lib" } use ABC; -regex between { \v+ } -regex file { \s* ** } - -my $abcs = $*IN.lines.join("\n"); -my @matches = $abcs.comb(m/ /, :match); +my @matches = $*IN.lines.join("\n").comb(m/ /, :match); for @matches { my %header = header_hash(.
); - say %header; -} + say %header ~ ":"; + + my @notes = gather for . -> $line + { + for $line -> $bar + { + for $bar + { + when . { take .[0]; take .[1]; } + when . { take .; } + } + } + } -# -# my @notes = gather for $match -> $line -# { -# for $line -> $bar -# { -# for $bar -# { -# when . { take .[0]; take .[1]; } -# when . { take .; } -# } -# } -# } -# -# my %header = header_hash($match
); -# my %key_signature = key_signature(%header); -# -# @notes.map({say . ~ " => " ~ apply_key_signature(%key_signature, .)}); + my %header = header_hash(.
); + my %key_signature = key_signature(%header); + + @notes.map({say . ~ " => " ~ apply_key_signature(%key_signature, .)}); +}