1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/irb
Takashi Kokubun 13f58eccda
Always color Symbol as Yellow on IRB::Color
Symbol color was made blue as a workaround because it was hard to
distinguish `foo`s in `:foo` and `def foo; end` (both are :on_ident).
But I wanted to make it yellow like pry.

`:Struct` had the same problem in :on_const. Because the :on_const was
also blue (but underlined and bold), it was not a big issue.

While they're not so problematic since we got a workaround, we also had
a more serious issue for highlighting a symbol like `:"a#{b}c"`.
The first half was considered as Symbol and the last half was considered
as String, because the colorizer did not have a state like a parser.

To approach the last issue, I introduced `IRB::Color::SymbolState` which
is a thin state manager knowing only "the token is Symbol or not". Having
this module magically solves the first two problems as well. So now we
can highlight Symbol as yellow in the perfect manner.
2019-05-25 20:47:33 -07:00
..
test_color.rb Always color Symbol as Yellow on IRB::Color 2019-05-25 20:47:33 -07:00
test_completion.rb make sync-default-gems GEM=irb 2019-04-27 22:01:11 +09:00
test_context.rb Copy config to make IRB::Context#use_colorize? functional 2019-05-21 04:32:17 -07:00
test_init.rb
test_option.rb make sync-default-gems GEM=irb 2019-04-27 22:01:11 +09:00
test_raise_no_backtrace_exception.rb make sync-default-gems GEM=irb 2019-04-27 22:01:11 +09:00
test_workspace.rb Add "require 'irb'" to use IRB.conf 2019-05-21 09:24:09 +09:00