eval_error.c: renamed an argument

* eval_error.c (print_errinfo): renamed argument `colored` as
  `highlight`, as it does not use colors.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-01-07 04:16:31 +00:00
Родитель f39ea3d189
Коммит 23a0a9b90d
1 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -86,7 +86,7 @@ error_print(rb_execution_context_t *ec)
}
static void
print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VALUE str, int colored)
print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VALUE str, int highlight)
{
static const char underline[] = "\033[4;1m";
static const char bold[] = "\033[1m";
@ -105,7 +105,7 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA
write_warn(str, ": ");
}
if (colored) write_warn(str, bold);
if (highlight) write_warn(str, bold);
if (!NIL_P(emesg)) {
einfo = RSTRING_PTR(emesg);
@ -114,7 +114,7 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA
}
if (eclass == rb_eRuntimeError && elen == 0) {
if (colored) write_warn(str, underline);
if (highlight) write_warn(str, underline);
write_warn(str, "unhandled exception\n");
}
else {
@ -122,7 +122,7 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA
epath = rb_class_name(eclass);
if (elen == 0) {
if (colored) write_warn(str, underline);
if (highlight) write_warn(str, underline);
write_warn_str(str, epath);
write_warn(str, "\n");
}
@ -139,10 +139,10 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA
write_warn_str(str, tail ? rb_str_subseq(emesg, 0, len) : emesg);
if (epath) {
write_warn(str, " (");
if (colored) write_warn(str, underline);
if (highlight) write_warn(str, underline);
write_warn_str(str, epath);
if (colored) write_warn(str, reset);
if (colored) write_warn(str, bold);
if (highlight) write_warn(str, reset);
if (highlight) write_warn(str, bold);
write_warn(str, ")\n");
}
if (tail) {
@ -151,7 +151,7 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA
if (tail ? einfo[elen-1] != '\n' : !epath) write_warn2(str, "\n", 1);
}
}
if (colored) write_warn(str, reset);
if (highlight) write_warn(str, reset);
}
static void