ruby-changes:55536
From: Takashi <ko1@a...>
Date: Fri, 26 Apr 2019 01:43:28 +0900 (JST)
Subject: [ruby-changes:55536] Takashi Kokubun:0408b8b390 (trunk): Syntax-highlight yield in IRB
https://git.ruby-lang.org/ruby.git/commit/?id=0408b8b390 From 0408b8b390f788693b10ad82281ae3d66ea52eb4 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Fri, 26 Apr 2019 01:43:11 +0900 Subject: Syntax-highlight yield in IRB diff --git a/lib/irb/color.rb b/lib/irb/color.rb index c18739c..9606c7b 100644 --- a/lib/irb/color.rb +++ b/lib/irb/color.rb @@ -25,7 +25,7 @@ module IRB # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/irb/color.rb#L25 on_ident: [[BLUE, BOLD], [Ripper::EXPR_ENDFN]], on_int: [[BLUE, BOLD], [Ripper::EXPR_END]], on_float: [[MAGENTA, BOLD], [Ripper::EXPR_END]], - on_kw: [[GREEN], [Ripper::EXPR_CLASS, Ripper::EXPR_BEG, Ripper::EXPR_END, Ripper::EXPR_FNAME]], + on_kw: [[GREEN], [Ripper::EXPR_ARG, Ripper::EXPR_CLASS, Ripper::EXPR_BEG, Ripper::EXPR_END, Ripper::EXPR_FNAME]], on_label: [[MAGENTA], [Ripper::EXPR_LABELED]], on_qwords_beg: [[RED], [Ripper::EXPR_BEG]], on_regexp_beg: [[RED, BOLD], [Ripper::EXPR_BEG]], diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb index 601b7a2..4b18785 100644 --- a/test/irb/test_color.rb +++ b/test/irb/test_color.rb @@ -24,6 +24,7 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_color.rb#L24 'ERB.new("a#{nil}b", trim_mode: "-")' => "#{BLUE}#{BOLD}#{UNDERLINE}ERB#{CLEAR}.new(#{RED}\"#{CLEAR}#{RED}a#{CLEAR}#{RED}\#{#{CLEAR}#{CYAN}#{BOLD}nil#{CLEAR}#{RED}}#{CLEAR}#{RED}b#{CLEAR}#{RED}\"#{CLEAR}, #{MAGENTA}trim_mode:#{CLEAR} #{RED}\"#{CLEAR}#{RED}-#{CLEAR}#{RED}\"#{CLEAR})", "# comment" => "#{BLUE}#{BOLD}# comment#{CLEAR}", '/r#{e}g/' => "#{RED}#{BOLD}/#{CLEAR}#{RED}r#{CLEAR}#{RED}\#{#{CLEAR}e}#{RED}g#{CLEAR}#{RED}#{BOLD}/#{CLEAR}", + "yield(hello)" => "#{GREEN}yield#{CLEAR}(hello)", }.each do |code, result| assert_equal(result, with_term { IRB::Color.colorize_code(code) }) end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/