[前][次][番号順一覧][スレッド一覧]

ruby-changes:49532

From: nobu <ko1@a...>
Date: Sun, 7 Jan 2018 13:16:35 +0900 (JST)
Subject: [ruby-changes:49532] nobu:r61647 (trunk): eval_error.c: renamed an argument

nobu	2018-01-07 13:16:31 +0900 (Sun, 07 Jan 2018)

  New Revision: 61647

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61647

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

  Modified files:
    trunk/eval_error.c
Index: eval_error.c
===================================================================
--- eval_error.c	(revision 61646)
+++ eval_error.c	(revision 61647)
@@ -86,7 +86,7 @@ error_print(rb_execution_context_t *ec) https://github.com/ruby/ruby/blob/trunk/eval_error.c#L86
 }
 
 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 https://github.com/ruby/ruby/blob/trunk/eval_error.c#L105
 	    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 https://github.com/ruby/ruby/blob/trunk/eval_error.c#L114
     }
 
     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 https://github.com/ruby/ruby/blob/trunk/eval_error.c#L122
 
 	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 https://github.com/ruby/ruby/blob/trunk/eval_error.c#L139
 	    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 https://github.com/ruby/ruby/blob/trunk/eval_error.c#L151
 	    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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]