[INFER] Fix colorized spew bug with ANSI reset codes. r=mrbkap

This commit is contained in:
Shu-yu Guo 2011-06-22 17:28:19 -07:00
parent 2a2f80872d
commit c34a1db790
2 changed files with 10 additions and 2 deletions

View File

@ -168,10 +168,18 @@ static bool InferSpewColorable()
#ifdef DEBUG
const char *
types::InferSpewColorReset()
{
if (!InferSpewColorable())
return "";
return "\x1b[0m";
}
const char *
types::InferSpewColor(TypeConstraint *constraint)
{
/* Type constraints are printed out using background colors. */
/* Type constraints are printed out using foreground colors. */
static const char *colors[] = { "\x1b[31m", "\x1b[32m", "\x1b[33m",
"\x1b[34m", "\x1b[35m", "\x1b[36m",
"\x1b[37m" };

View File

@ -1038,7 +1038,7 @@ enum SpewChannel {
#ifdef DEBUG
inline const char * InferSpewColorReset() { return "\x1b[0m"; }
const char * InferSpewColorReset();
const char * InferSpewColor(TypeConstraint *constraint);
const char * InferSpewColor(TypeSet *types);