Skip to content

Commit

Permalink
Remove unnecessary ignore_error in dispatch_seq
Browse files Browse the repository at this point in the history
Just forgotten in a5804c3
  • Loading branch information
k0kubun committed Dec 29, 2020
1 parent a5804c3 commit e42e548
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/irb/color.rb
Expand Up @@ -130,7 +130,7 @@ def colorize_code(code, complete: true, ignore_error: false)
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
Expand Down Expand Up @@ -195,9 +195,9 @@ def scan(code, allow_last_error:)
$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)
Expand Down

0 comments on commit e42e548

Please sign in to comment.