#!/bin/bash if [ $# -eq 0 ]; then # Colour stdin exec perl -pe ' s/^(.?Warning:.*)$/\e[30;43m$1\e[0m/mg; s/^(.?Error:(?! The behavior up to this point is).*|\*\*\*.*Error.*)$/\e[97;41m$1\e[0m/mg; s/^(.*Attempted to select nonexistent field.*)$/\e[97;41m$1\e[0m/mg; s/^(Lexical error at .*)$/\e[97;41m$1\e[0m/mg; s/^(State \d+: <)(\S+?)( line.+)$/\e[93m$1\e[0;30;43m$2\e[0;93m$3\e[0m/mg; s/^(State \d+:.*)$/\e[93m$1\e[0m/mg; s/^(Model checking completed. No error.*)$/\e[30;42m$1\e[0m/mg; #s/[Ll]ine (\d+?), col(?:umn)? (\d+)/$1:$2/g; s/^(\d+\.) Line (\d+?), column (\d+?) to line (\d+?), column (\d+?)/$1 $2:$3 to $4:$5/mg; s/^(The exception was .+?[\r\n]+.*?)$/\e[97;41m$1\e[0m/mg; ' else # Run tlc exec "$(dirname "$0")"/tlc "$@" | "$0" fi