mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Colorize imaginary and rational literals
This commit is contained in:
parent
23270f6fee
commit
4f2a7b8001
2 changed files with 4 additions and 0 deletions
|
@ -31,7 +31,9 @@ module IRB # :nodoc:
|
|||
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]],
|
||||
|
|
|
@ -25,6 +25,8 @@ module TestIRB
|
|||
{
|
||||
"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}",
|
||||
|
|
Loading…
Reference in a new issue