aboutsummaryrefslogtreecommitdiffstats
path: root/lib/irb/color.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-11-13 15:10:05 +0900
committeraycabta <aycabta@gmail.com>2019-11-13 15:15:28 +0900
commita5b6d7bca84fce6e13c68e8753893c4697960e3a (patch)
treed31f7f82bdd78007b94f1cbb90a30e56550a610f /lib/irb/color.rb
parentc33d29fba5a04bd31242eb51e54d2ec198c34ba3 (diff)
downloadruby-a5b6d7bca84fce6e13c68e8753893c4697960e3a.tar.gz
Suppress warnings except for when last evaluation
Co-authored-by: Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
Diffstat (limited to 'lib/irb/color.rb')
-rw-r--r--lib/irb/color.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/irb/color.rb b/lib/irb/color.rb
index 3ce628ff24..d2b9674a71 100644
--- a/lib/irb/color.rb
+++ b/lib/irb/color.rb
@@ -154,6 +154,7 @@ module IRB # :nodoc:
def scan(code, allow_last_error:)
pos = [1, 0]
+ verbose, $VERBOSE = $VERBOSE, nil
lexer = Ripper::Lexer.new(code)
if lexer.respond_to?(:scan) # Ruby 2.7+
lexer.scan.each do |elem|
@@ -177,6 +178,7 @@ module IRB # :nodoc:
yield(elem.event, elem.tok, elem.state)
end
end
+ $VERBOSE = verbose
end
def dispatch_seq(token, expr, str, in_symbol:)