[前][次][番号順一覧][スレッド一覧]

ruby-changes:55978

From: Takashi <ko1@a...>
Date: Tue, 4 Jun 2019 00:37:17 +0900 (JST)
Subject: [ruby-changes:55978] Takashi Kokubun: 9987f45765 (trunk): Reflect behavior changes to argument name

https://git.ruby-lang.org/ruby.git/commit/?id=9987f45765

From 9987f457652f99794c3a8d4467c06ed770cdd393 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Tue, 4 Jun 2019 00:35:58 +0900
Subject: Reflect behavior changes to argument name

0c459af7c233adb5f44022350bfe8fa132d8053e changed the meaning of
`detect_compile_error`, and this commit lets it follow the change.

diff --git a/lib/irb/color.rb b/lib/irb/color.rb
index 4996ccf..fa8502c 100644
--- a/lib/irb/color.rb
+++ b/lib/irb/color.rb
@@ -108,7 +108,7 @@ module IRB # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/irb/color.rb#L108
         colored = +''
         length = 0
 
-        scan(code, detect_compile_error: complete) do |token, str, expr|
+        scan(code, allow_last_error: !complete) do |token, str, expr|
           in_symbol = symbol_state.scan_token(token)
           str.each_line do |line|
             line = Reline::Unicode.escape_for_print(line)
@@ -132,12 +132,12 @@ module IRB # :nodoc: https://github.com/ruby/ruby/blob/trunk/lib/irb/color.rb#L132
 
       private
 
-      def scan(code, detect_compile_error:)
+      def scan(code, allow_last_error:)
         pos = [1, 0]
 
         Ripper::Lexer.new(code).scan.each do |elem|
           str = elem.tok
-          next if !detect_compile_error and elem.message&.end_with?("meets end of file")
+          next if allow_last_error and elem.message&.end_with?('meets end of file')
           next if ([elem.pos[0], elem.pos[1] + str.bytesize] <=> pos) <= 0
 
           str.each_line do |line|
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]