ruby-changes:64656
From: Takashi <ko1@a...>
Date: Tue, 29 Dec 2020 16:30:05 +0900 (JST)
Subject: [ruby-changes:64656] 6d07785127 (master): [ruby/irb] Remove unnecessary ignore_error in dispatch_seq
https://git.ruby-lang.org/ruby.git/commit/?id=6d07785127 From 6d07785127d5e26340eb24eec8542470bd5fe883 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun <takashikkbn@g...> Date: Mon, 28 Dec 2020 23:25:01 -0800 Subject: [ruby/irb] Remove unnecessary ignore_error in dispatch_seq Just forgotten in https://github.com/ruby/irb/commit/a5804c3560bb1de3ea8e40002635bff87f6a2825 https://github.com/ruby/irb/commit/e42e548793 diff --git a/lib/irb/color.rb b/lib/irb/color.rb index eb157be..37b0c22 100644 --- a/lib/irb/color.rb +++ b/lib/irb/color.rb @@ -130,7 +130,7 @@ module IRB # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/irb/color.rb#L130 in_symbol = symbol_state.scan_token(token) str.each_line do |line| line = Reline::Unicode.escape_for_print(line) - if seq = dispatch_seq(token, expr, line, in_symbol: in_symbol, ignore_error: ignore_error) + if seq = dispatch_seq(token, expr, line, in_symbol: in_symbol) colored << seq.map { |s| "\e[#{s}m" }.join('') colored << line.sub(/\Z/, clear) else @@ -195,9 +195,9 @@ module IRB # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/irb/color.rb#L195 $VERBOSE = verbose end - def dispatch_seq(token, expr, str, in_symbol:, ignore_error:) + def dispatch_seq(token, expr, str, in_symbol:) if ERROR_TOKENS.include?(token) - ignore_error ? nil : TOKEN_SEQ_EXPRS[token][0] + TOKEN_SEQ_EXPRS[token][0] elsif in_symbol [YELLOW] elsif TOKEN_KEYWORDS.fetch(token, []).include?(str) -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/