aboutsummaryrefslogtreecommitdiffstats
path: root/lib/irb
Commit message (Collapse)AuthorAgeFilesLines
* ripper: Ripper::Lexer#scanNobuyoshi Nakada2019-05-291-14/+10
| | | | | | * ext/ripper/lib/ripper/lexer.rb (Ripper::Lexer#scan): parses the code and returns the result elements including errors. [EXPERIMENTAL]
* Colorize compile_error as same as on_parse_errorNobuyoshi Nakada2019-05-291-2/+3
|
* parse.y: flush invalid charNobuyoshi Nakada2019-05-291-1/+3
|
* Revert "Colorize error part more"Koichi Sasada2019-05-291-28/+11
| | | | This reverts commit c7f3c222c9b82736c993419daa6bfb643e5c0793.
* Colorize error part moreNobuyoshi Nakada2019-05-291-11/+28
| | | | Colorize `compile_error` parts as well as `on_parse_error` parts.
* Use IO.copy_streamaycabta2019-05-291-3/+1
|
* Check RUBY_YES_I_AM_NOT_A_NORMAL_USER env to access RubyVM docaycabta2019-05-291-1/+1
|
* IRB never show RubyVM's docaycabta2019-05-292-1/+49
|
* Encode completed strings corecctlyaycabta2019-05-291-1/+1
|
* Remove unused variable from IRB::InputCompletoraycabta2019-05-281-1/+0
|
* Treat :@1, :@@1, @1, and @@1 correctly to check terminationaycabta2019-05-281-0/+15
|
* Supress duplicated warningKazuki Tsujimoto2019-05-281-0/+3
|
* Colorize error partNobuyoshi Nakada2019-05-271-2/+16
|
* context.rb: hide wrapping linesNobuyoshi Nakada2019-05-271-1/+2
| | | | | | * lib/irb/context.rb (IRB::Context#evaluate): separate the code from wrapping lines to propagate the given exception, not to show the wrapping lines when SyntaxError.
* Use IRB::InputMethod#eof? to quitaycabta2019-05-272-2/+2
|
* Add support for history with Reline backendSutou Kouhei2019-05-271-4/+6
|
* Highlight global variable on IRBTakashi Kokubun2019-05-261-1/+2
|
* Simplify lexer state matching in #dispatch_seqTakashi Kokubun2019-05-261-26/+30
| | | | for improving readability of the condition. It may be slightly faster, or may not.
* Refactor IRB color dispatchTakashi Kokubun2019-05-261-29/+31
| | | | | | | | | | | | | | | The reason why we were checking lexer state in addition to token was that we do not want to colorize local variable, method call, etc., while they share the :on_ident token with a name of method definition which should be colored as blue. It means that we're concerned about the lexer state only for :on_ident. Thus we can skip checking lexer state for non-:on_ident tokens. This refactoring is based on that idea. Also, now we manage Ripper's lexer state as Integer (use `|` if you need to check multiple states). It should be faster than using Array of Integer because #any? block call is not needed.
* Support op, cvar, iver, gvar and kw that follow on symbeg in IRBaycabta2019-05-271-1/+2
|
* Support :@@cvar and : on colorizeaycabta2019-05-271-1/+1
|
* Make the imaginary color on IRB close to pryTakashi Kokubun2019-05-261-5/+7
| | | | and sorted the token names alphabetically.
* Fix number literal regexp of IRB completionaycabta2019-05-271-1/+1
|
* Use correctly RI output in IRB completionaycabta2019-05-271-28/+111
|
* Colorize imaginary and rational literalsNobuyoshi Nakada2019-05-261-0/+2
|
* Handle keyword symbol in IRB::Color::SymbolStateTakashi Kokubun2019-05-251-1/+1
|
* Deal with more syntax highlight edge casesTakashi Kokubun2019-05-251-1/+3
| | | | Please refer to the tests again.
* Fix more unintended syntax highlightsTakashi Kokubun2019-05-251-18/+11
| | | | See tests for what kind of things are fixed.
* Always color Symbol as Yellow on IRB::ColorTakashi Kokubun2019-05-251-4/+51
| | | | | | | | | | | | | | | | | | | 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.
* Colorize empty embexpr more on IRB::ColorTakashi Kokubun2019-05-251-2/+2
|
* Support some unhandled syntax highlightTakashi Kokubun2019-05-251-2/+6
| | | | | | Heredoc, %i, :Foo, { 'a': ... }, ... :'a' is still half-broken.
* Clear IRB::Color escape sequence before newlineTakashi Kokubun2019-05-251-1/+1
| | | | because otherwise prompt and other things could be polluted.
* Add and use Reline::Unicode.escape_for_printTakashi Kokubun2019-05-252-7/+13
|
* Respect --nocolorize on REPL source highlightTakashi Kokubun2019-05-251-3/+5
|
* Incremental syntax highlight for IRB source linesTakashi Kokubun2019-05-242-1/+13
| | | | Closes: https://github.com/ruby/ruby/pull/2202
* JSON like label ends by differs from the startaycabta2019-05-251-2/+2
| | | | | | | | | | | | | | pp Ripper.lex('{ "a": 3 }') => [[[1, 0], :on_lbrace, "{", EXPR_BEG|EXPR_LABEL], [[1, 1], :on_sp, " ", EXPR_BEG|EXPR_LABEL], [[1, 2], :on_tstring_beg, "\"", EXPR_BEG|EXPR_LABEL], [[1, 3], :on_tstring_content, "a", EXPR_BEG|EXPR_LABEL], [[1, 4], :on_label_end, "\":", EXPR_BEG|EXPR_LABEL], [[1, 6], :on_sp, " ", EXPR_BEG|EXPR_LABEL], [[1, 7], :on_int, "3", EXPR_END], [[1, 8], :on_sp, " ", EXPR_END], [[1, 9], :on_rbrace, "}", EXPR_END]]
* Show documents when completionaycabta2019-05-252-0/+10
|
* Use Reline as Reidline multiline editor in IRBaycabta2019-05-255-22/+138
|
* Use colorized IRB on Windows without checking `TERM`NAKAMURA Usaku2019-05-231-1/+1
|
* Copy config to make IRB::Context#use_colorize? functionalTakashi Kokubun2019-05-211-0/+1
| | | | | | on initialize This fixes https://github.com/ruby/ruby/pull/2188
* Symbol beginning token may take a constant tokenaycabta2019-05-211-1/+1
|
* IRB should eval and show an error when only `.` is inputtedaycabta2019-05-211-1/+7
|
* Check whether IRB.conf is nil in IRB::WorkSpace#code_around_bindingaycabta2019-05-211-2/+6
|
* Add --colorize and --nocolorize options to IRBaycabta2019-05-216-4/+23
|
* Use Ripper for IRBaycabta2019-04-305-1094/+192
| | | | | The debug option of IRB is deleted because it's just for IRB's pure Ruby parser.
* make sync-default-gems GEM=irbTakashi Kokubun2019-04-281-6/+6
| | | | | | from https://github.com/ruby/irb/commit/e8e79d569ed59fe4ed4fbca968917ce799f02a5e. This colorizes Range object on IRB inspect.
* make sync-default-gems GEM=irbTakashi Kokubun2019-04-281-2/+3
| | | | | | from https://github.com/ruby/irb/commit/44301d382794d91e2caa16dd4efe62439e0041d8. This includes some fixes for string interpolation highlight fixes.
* make sync-default-gems GEM=irbTakashi Kokubun2019-04-281-1/+1
| | | | | | | | | from https://github.com/ruby/irb/commit/89e9add06da3fd5f9ce91a2f5fa0b0190aa5d42f. This adds syntax highlight support for Module on inspect. In addition to that, I'm adding a trailing space in test_color.rb for testing ruby-commit-hook's auto-style.
* make sync-default-gems GEM=irbTakashi Kokubun2019-04-271-0/+4
| | | | | Synced from https://github.com/ruby/irb/commit/5feb361ed80736efa5b2c2b629837ec2a5fc2cdb. This includes a support to colorize named Class instance on IRB inspect.
* make sync-default-gems GEM=irbTakashi Kokubun2019-04-271-1/+1
| | | | Backport changes from ruby/irb.