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

ruby-changes:58698

From: Takashi <ko1@a...>
Date: Mon, 11 Nov 2019 06:42:07 +0900 (JST)
Subject: [ruby-changes:58698] 25c53a8eec (master): Colorize on_symbols_beg (%I)

https://git.ruby-lang.org/ruby.git/commit/?id=25c53a8eec

From 25c53a8eec4f73f4d0d127144b24bf68218149e3 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Sun, 10 Nov 2019 13:41:34 -0800
Subject: Colorize on_symbols_beg (%I)


diff --git a/lib/irb/color.rb b/lib/irb/color.rb
index 9436c19..92bbd9e 100644
--- a/lib/irb/color.rb
+++ b/lib/irb/color.rb
@@ -52,6 +52,7 @@ module IRB # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/irb/color.rb#L52
         on_regexp_beg:      [[RED, BOLD],             ALL],
         on_regexp_end:      [[RED, BOLD],             ALL],
         on_symbeg:          [[YELLOW],                ALL],
+        on_symbols_beg:     [[RED, BOLD],             ALL],
         on_tstring_beg:     [[RED, BOLD],             ALL],
         on_tstring_content: [[RED],                   ALL],
         on_tstring_end:     [[RED, BOLD],             ALL],
diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb
index d6d4b0d..6446c0a 100644
--- a/test/irb/test_color.rb
+++ b/test/irb/test_color.rb
@@ -35,8 +35,16 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_color.rb#L35
         '/r#{e}g/' => "#{RED}#{BOLD}/#{CLEAR}#{RED}r#{CLEAR}#{RED}\#{#{CLEAR}e#{RED}}#{CLEAR}#{RED}g#{CLEAR}#{RED}#{BOLD}/#{CLEAR}",
         "'a\nb'" => "#{RED}#{BOLD}'#{CLEAR}#{RED}a#{CLEAR}\n#{RED}b#{CLEAR}#{RED}#{BOLD}'#{CLEAR}",
         "[1]]]\u0013" => "[1]]]^S",
+        "%[str]" => "#{RED}#{BOLD}%[#{CLEAR}#{RED}str#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
+        "%Q[str]" => "#{RED}#{BOLD}%Q[#{CLEAR}#{RED}str#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
+        "%q[str]" => "#{RED}#{BOLD}%q[#{CLEAR}#{RED}str#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
+        "%x[cmd]" => "#{RED}#{BOLD}%x[#{CLEAR}#{RED}cmd#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
+        "%r[reg]" => "#{RED}#{BOLD}%r[#{CLEAR}#{RED}reg#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
         "%w[a b]" => "#{RED}#{BOLD}%w[#{CLEAR}#{RED}a#{CLEAR} #{RED}b#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
+        "%W[a b]" => "#{RED}#{BOLD}%W[#{CLEAR}#{RED}a#{CLEAR} #{RED}b#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
+        "%s[a b]" => "#{YELLOW}%s[#{CLEAR}#{YELLOW}a b#{CLEAR}#{YELLOW}]#{CLEAR}",
         "%i[c d]" => "#{RED}#{BOLD}%i[#{CLEAR}#{RED}c#{CLEAR} #{RED}d#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
+        "%I[c d]" => "#{RED}#{BOLD}%I[#{CLEAR}#{RED}c#{CLEAR} #{RED}d#{CLEAR}#{RED}#{BOLD}]#{CLEAR}",
         "{'a': 1}" => "{#{RED}#{BOLD}'#{CLEAR}#{RED}a#{CLEAR}#{RED}#{BOLD}':#{CLEAR} #{BLUE}#{BOLD}1#{CLEAR}}",
         ":Struct" => "#{YELLOW}:#{CLEAR}#{YELLOW}Struct#{CLEAR}",
         '"#{}"' => "#{RED}#{BOLD}\"#{CLEAR}#{RED}\#{#{CLEAR}#{RED}}#{CLEAR}#{RED}#{BOLD}\"#{CLEAR}",
-- 
cgit v0.10.2


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

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