Skip to content

Instantly share code, notes, and snippets.

@vendethiel
Created March 20, 2015 15:30
Show Gist options
  • Save vendethiel/fc7a5de4738da4c2f70b to your computer and use it in GitHub Desktop.
Save vendethiel/fc7a5de4738da4c2f70b to your computer and use it in GitHub Desktop.
subset File of Str of *.IO.e;
enum Color «:BUG(37) :TODO(36) :FIXME(33) :XXX(31)»;
sub color(Color $c, Str $msg) {
"\033[$cm$msg\033[0m";
}
sub process(File $file) {
gather for $file.lines.kv -> $i, $l {
take " $i: {Color::{$0}, $_)};" when /<|b>(BUG|TODO|FIXME|XXX)<|b>/;
}
}
sub MAIN(File @files) {
say "$_:", @tasks.join("\n") if my @tasks = process($_) for @files;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment