ruby-changes:55852
From: Nobuyoshi <ko1@a...>
Date: Sun, 26 May 2019 23:50:59 +0900 (JST)
Subject: [ruby-changes:55852] Nobuyoshi Nakada: 4f2a7b8001 (trunk): Colorize imaginary and rational literals
https://git.ruby-lang.org/ruby.git/commit/?id=4f2a7b8001 From 4f2a7b800110346292890e3bed41b37f3f58ab0b Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 26 May 2019 23:44:57 +0900 Subject: Colorize imaginary and rational literals diff --git a/lib/irb/color.rb b/lib/irb/color.rb index 51facaa..852d184 100644 --- a/lib/irb/color.rb +++ b/lib/irb/color.rb @@ -31,7 +31,9 @@ module IRB # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/irb/color.rb#L31 on_heredoc_end: [[RED], [Ripper::EXPR_BEG]], on_ident: [[BLUE, BOLD], [Ripper::EXPR_ENDFN]], on_int: [[BLUE, BOLD], [Ripper::EXPR_END]], + on_rational: [[BLUE, BOLD], [Ripper::EXPR_END]], on_float: [[MAGENTA, BOLD], [Ripper::EXPR_END]], + on_imaginary: [[MAGENTA, BOLD], [Ripper::EXPR_END]], on_kw: [[GREEN], [Ripper::EXPR_ARG, Ripper::EXPR_CLASS, Ripper::EXPR_BEG, Ripper::EXPR_END, Ripper::EXPR_FNAME, Ripper::EXPR_MID]], on_label: [[MAGENTA], [Ripper::EXPR_LABELED]], on_label_end: [[RED], [Ripper::EXPR_BEG]], diff --git a/test/irb/test_color.rb b/test/irb/test_color.rb index 3ba0c4c..3d0eee7 100644 --- a/test/irb/test_color.rb +++ b/test/irb/test_color.rb @@ -25,6 +25,8 @@ module TestIRB https://github.com/ruby/ruby/blob/trunk/test/irb/test_color.rb#L25 { "1" => "#{BLUE}#{BOLD}1#{CLEAR}", "2.3" => "#{MAGENTA}#{BOLD}2.3#{CLEAR}", + "7r" => "#{BLUE}#{BOLD}7r#{CLEAR}", + "8i" => "#{MAGENTA}#{BOLD}8i#{CLEAR}", "['foo', :bar]" => "[#{RED}'#{CLEAR}#{RED}foo#{CLEAR}#{RED}'#{CLEAR}, #{YELLOW}:#{CLEAR}#{YELLOW}bar#{CLEAR}]", "class A; end" => "#{GREEN}class#{CLEAR} #{BLUE}#{BOLD}#{UNDERLINE}A#{CLEAR}; #{GREEN}end#{CLEAR}", "def self.foo; bar; end" => "#{GREEN}def#{CLEAR} #{CYAN}#{BOLD}self#{CLEAR}.#{BLUE}#{BOLD}foo#{CLEAR}; bar; #{GREEN}end#{CLEAR}", -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/