aboutsummaryrefslogtreecommitdiffstats
path: root/test/irb
Commit message (Collapse)AuthorAgeFilesLines
* Add require "irb" to test/irb/test_completion.rbaycabta2019-11-281-1/+2
|
* Fix regexp to complete complex literalaycabta2019-11-281-0/+5
| | | | | | IRB completion logic always needed exponential notation for complex literal such as 3e6i but it's bug. I fixed to support complex literal without exponential notation such as 3i.
* Use singleline/multiline instead of readline/reidlineaycabta2019-11-211-1/+1
|
* Generate history file path correctly when $HOME/.irbrc doesn't existaycabta2019-11-201-0/+40
|
* Suppress warnings except for when last evaluationaycabta2019-11-131-0/+6
| | | | Co-authored-by: Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* qsymbols and symbols should be colored as SymbolTakashi Kokubun2019-11-101-3/+3
|
* Colorize on_symbols_beg (%I)Takashi Kokubun2019-11-101-0/+8
|
* Colorize string quotes as boldTakashi Kokubun2019-11-101-23/+23
| | | | like pry
* IRB colorize: take into account recursive arrays and hashes (#2555)Ary Borenszweig2019-10-141-0/+2
| | | [Bug #16250]
* Changed numbered parameter prefixNobuyoshi Nakada2019-09-241-2/+0
|
* Set IRB::Context#return_format on test clarifyaycabta2019-08-161-0/+1
|
* Don't echo results of assignment expressionsSteven Willis2019-08-162-0/+126
|
* Aliases capture_output to capture_io for test-unit compatiblity.Hiroshi SHIBATA2019-08-081-1/+1
|
* Revert "Don't echo results of assignment expressions"aycabta2019-08-062-126/+0
| | | | This reverts commit 1ee88c51b3c319b74b69540e111e4a1c24833cad.
* Don't echo results of assignment expressionsSteven Willis2019-08-062-0/+126
|
* Clarify the Ruby version support status in IRB moreTakashi Kokubun2019-06-131-13/+19
|
* make sync-default-gems GEM=irbTakashi Kokubun2019-06-134-21/+50
| | | | | | Upgrade IRB to https://github.com/ruby/irb/commit/41ea43a4a732e094acfa1b0fc1473fdcda9e6227 Mostly backport changes.
* Another incomplete string caseNobuyoshi Nakada2019-06-121-0/+2
|
* Ripper::Lexer: fallback parse error token to the previous oneNobuyoshi Nakada2019-06-121-1/+1
|
* Remove conflict resolution mistake [ci skip]Takashi Kokubun2019-06-041-2/+2
| | | | in de541fe1961370e64541d73c96cf790d30f28604 :bow:
* Improve test_color to prevent regressionTakashi Kokubun2019-06-041-2/+1
| | | | | Actually de541fe1961370e64541d73c96cf790d30f28604 was still needed. This commit would improve the test coverage using the branch.
* colorize_code must return escaped textTakashi Kokubun2019-06-041-2/+3
| | | | | This was needed before 0c459af7c233adb5f44022350bfe8fa132d8053e but it could be actually useless now. But I added this anyway just in case.
* Colorize error charactersNobuyoshi Nakada2019-06-041-8/+5
| | | | | | * lib/irb/color.rb (IRB::Color.scan): ignore "incomplete end of input" error only, to colorize invalid characters, e.g., control characters, and invalid symbols, as errors.
* Warn compile_error only when input is finishedTakashi Kokubun2019-05-311-3/+31
| | | | | | | | | | | | | | | | | | | | Let's say we are in progress to write `"foo"`: ``` irb> "fo ``` at this moment, nothing is wrong. It would be just a normal way to write `"foo"`. Prior to this commit, the `fo` part was warned because of 5b64d7ac6e7cbf759b859428f125539e58bac0bd. But I think warning such a normal input is not valuable for users. However, we'd like to warn `:@1` or `@@1` which is also a syntax error. Then this commit switches the syntax highlight based on whether the input text is finished or not. When it's not finished yet, it does not warn compile_error.
* Colorize errors moreNobuyoshi Nakada2019-05-291-0/+1
| | | | | * lib/irb/color.rb (IRB::Color.colorize_code): colorize `compile_error` part as same as `on_parse_error`.
* Colorize compile_error as same as on_parse_errorNobuyoshi Nakada2019-05-291-1/+1
|
* Colorize error partNobuyoshi Nakada2019-05-271-1/+3
|
* context.rb: hide wrapping linesNobuyoshi Nakada2019-05-271-0/+5
| | | | | | * 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.
* Highlight global variable on IRBTakashi Kokubun2019-05-261-0/+1
|
* Refactor IRB color dispatchTakashi Kokubun2019-05-261-1/+1
| | | | | | | | | | | | | | | 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 :@@cvar and : on colorizeaycabta2019-05-271-1/+1
|
* Make the imaginary color on IRB close to pryTakashi Kokubun2019-05-261-1/+1
| | | | and sorted the token names alphabetically.
* Colorize imaginary and rational literalsNobuyoshi Nakada2019-05-261-0/+2
|
* parse.y: adjust error indicatorNobuyoshi Nakada2019-05-261-1/+1
| | | | | | | | | | | | | | | | | * parse.y (parser_yylex): adjust the error indicator of unexpected fraction part. before: ~~~ 1.2.3 ^~~ ~~~ after: ~~~ 1.2.3 ^~ ~~~
* Fix scanner event at invalid syntaxNobuyoshi Nakada2019-05-261-1/+1
| | | | | | * parse.y (parser_yyerror, parser_compile_error): revert r67224 (e5d10cda07b23682e5e4e64d1324e4d3247d4785) "Flush erred token".
* Handle keyword symbol in IRB::Color::SymbolStateTakashi Kokubun2019-05-251-0/+1
|
* Deal with more syntax highlight edge casesTakashi Kokubun2019-05-251-1/+4
| | | | Please refer to the tests again.
* Fix more unintended syntax highlightsTakashi Kokubun2019-05-251-0/+12
| | | | See tests for what kind of things are fixed.
* Always color Symbol as Yellow on IRB::ColorTakashi Kokubun2019-05-251-2/+6
| | | | | | | | | | | | | | | | | | | 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-0/+1
|
* Support some unhandled syntax highlightTakashi Kokubun2019-05-251-0/+6
| | | | | | Heredoc, %i, :Foo, { 'a': ... }, ... :'a' is still half-broken.
* Clear IRB::Color escape sequence before newlineTakashi Kokubun2019-05-251-2/+16
| | | | because otherwise prompt and other things could be polluted.
* Add and use Reline::Unicode.escape_for_printTakashi Kokubun2019-05-251-0/+1
|
* Incremental syntax highlight for IRB source linesTakashi Kokubun2019-05-241-0/+3
| | | | Closes: https://github.com/ruby/ruby/pull/2202
* Copy config to make IRB::Context#use_colorize? functionalTakashi Kokubun2019-05-211-0/+4
| | | | | | on initialize This fixes https://github.com/ruby/ruby/pull/2188
* Add "require 'irb'" to use IRB.confaycabta2019-05-211-0/+1
|
* Use Ripper for IRBaycabta2019-04-301-108/+0
| | | | | 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-0/+1
| | | | | | from https://github.com/ruby/irb/commit/e8e79d569ed59fe4ed4fbca968917ce799f02a5e. This colorizes Range object on IRB inspect.
* make sync-default-gems GEM=irbTakashi Kokubun2019-04-281-7/+2
| | | | | | | from https://github.com/ruby/irb/commit/96f05e726879e9858eb015c8d043c9f52b864ff9. Just syncing newer test changes so that conflicts do not happen when trunk is modified and we need to backport that to ruby/irb.
* make sync-default-gems GEM=irbTakashi Kokubun2019-04-281-13/+9
| | | | | | from https://github.com/ruby/irb/commit/44301d382794d91e2caa16dd4efe62439e0041d8. This includes some fixes for string interpolation highlight fixes.