aboutsummaryrefslogtreecommitdiffstats
path: root/lib/irb.rb
diff options
context:
space:
mode:
authorStan Lo <stan001212@gmail.com>2023-05-19 04:00:29 +0900
committergit <svn-admin@ruby-lang.org>2023-05-18 19:00:33 +0000
commitcfb79973537e081da0ab1aa828883524716efe72 (patch)
tree93b551c71fa08320b7ec76c964f6b32f82ef15a7 /lib/irb.rb
parentd74b32db9d1e0234b17e4645d270394f7b657f85 (diff)
downloadruby-cfb79973537e081da0ab1aa828883524716efe72.tar.gz
[ruby/irb] Refactor RubyLex's input/io methods
(https://github.com/ruby/irb/pull/583) 1. Make `RubyLex#set_input` simply assign the input block. This matches the behavior of `RubyLex#set_prompt`. 2. Merge `RubyLex#set_input`'s IO configuration logic with `#set_auto_indent` into `#configure_io`.
Diffstat (limited to 'lib/irb.rb')
-rw-r--r--lib/irb.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/irb.rb b/lib/irb.rb
index 13fbbbad29..26432a0fac 100644
--- a/lib/irb.rb
+++ b/lib/irb.rb
@@ -537,7 +537,7 @@ module IRB
@context.io.prompt
end
- @scanner.set_input(@context.io) do
+ @scanner.set_input do
signal_status(:IN_INPUT) do
if l = @context.io.gets
print l if @context.verbose?
@@ -555,7 +555,7 @@ module IRB
end
end
- @scanner.set_auto_indent
+ @scanner.configure_io(@context.io)
@scanner.each_top_level_statement do |line, line_no|
signal_status(:IN_EVAL) do