mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Handle keyword symbol in IRB::Color::SymbolState
This commit is contained in:
parent
52b09fcee1
commit
aaf6c678d2
2 changed files with 2 additions and 1 deletions
|
@ -136,7 +136,7 @@ module IRB # :nodoc:
|
|||
case token
|
||||
when :on_symbeg
|
||||
@stack << true
|
||||
when :on_ident, :on_op, :on_const, :on_ivar
|
||||
when :on_ident, :on_op, :on_const, :on_ivar, :on_kw
|
||||
if @stack.last # Pop only when it's Symbol
|
||||
@stack.pop
|
||||
return prev_state
|
||||
|
|
|
@ -49,6 +49,7 @@ module TestIRB
|
|||
"[__FILE__, __LINE__]" => "[#{CYAN}#{BOLD}__FILE__#{CLEAR}, #{CYAN}#{BOLD}__LINE__#{CLEAR}]",
|
||||
":self" => "#{YELLOW}:#{CLEAR}#{YELLOW}self#{CLEAR}",
|
||||
":class" => "#{YELLOW}:#{CLEAR}#{YELLOW}class#{CLEAR}",
|
||||
"[:end, 2]" => "[#{YELLOW}:#{CLEAR}#{YELLOW}end#{CLEAR}, #{BLUE}#{BOLD}2#{CLEAR}]",
|
||||
"[:>, 3]" => "[#{YELLOW}:#{CLEAR}#{YELLOW}>#{CLEAR}, #{BLUE}#{BOLD}3#{CLEAR}]",
|
||||
":Hello ? world : nil" => "#{YELLOW}:#{CLEAR}#{YELLOW}Hello#{CLEAR} ? world : #{CYAN}#{BOLD}nil#{CLEAR}",
|
||||
'raise "foo#{bar}baz"' => "raise #{RED}\"#{CLEAR}#{RED}foo#{CLEAR}#{RED}\#{#{CLEAR}bar#{RED}}#{CLEAR}#{RED}baz#{CLEAR}#{RED}\"#{CLEAR}",
|
||||
|
|
Loading…
Reference in a new issue