#!perl -plw
# perl cabal-description2.pl | perl classify-ghc-errors-with-description2.pl | perl colorize-classified.pl
use Term::ANSIColor;
use FileHandle;
BEGIN{
    STDOUT->autoflush(1);
}

if(/(.* Synopsis:)(.*)/){
    $_=$1.colored(["bold blue"],$2);
}
if(/(.*)( ERROR\s+.*)/){
    $_=$1.colored(["bold red"],$2);
}
if(/(.* ROOT FAILURE )(\S+)(-[0-9.]+)$/){
    $_=$1.colored(["green"],$2).$3;
}
