aboutsummaryrefslogtreecommitdiffstats
path: root/regerror.c
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-05-25 20:47:29 -0700
committerTakashi Kokubun <takashikkbn@gmail.com>2019-05-25 20:47:33 -0700
commit13f58eccdab374ab14d33a6882c52e048cb52e3c (patch)
tree7e9b6d0d23b14d82bcffd6af1b4fa62830bbdbc3 /regerror.c
parenta516834b47de810b53241c66f677fafd4485bebd (diff)
downloadruby-13f58eccdab374ab14d33a6882c52e048cb52e3c.tar.gz
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.
Diffstat (limited to 'regerror.c')
0 files changed, 0 insertions, 0 deletions