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

ruby-changes:58848

From: aycabta <ko1@a...>
Date: Wed, 20 Nov 2019 08:41:04 +0900 (JST)
Subject: [ruby-changes:58848] 49b4507fd3 (master): Number sign comment (# bla bla) is a kind of newline character

https://git.ruby-lang.org/ruby.git/commit/?id=49b4507fd3

From 49b4507fd3caed356e4039da5820a7c843c6b05a Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Wed, 20 Nov 2019 08:39:43 +0900
Subject: Number sign comment (# bla bla) is a kind of newline character


diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index 58a3e1e..81024ea 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -332,7 +332,7 @@ class RubyLex https://github.com/ruby/ruby/blob/trunk/lib/irb/ruby-lex.rb#L332
     depth_difference = 0
     @tokens.each_with_index do |t, index|
       case t[1]
-      when :on_ignored_nl, :on_nl
+      when :on_ignored_nl, :on_nl, :on_comment
         if index != (@tokens.size - 1)
           depth_difference = 0
         end
@@ -381,7 +381,7 @@ class RubyLex https://github.com/ruby/ruby/blob/trunk/lib/irb/ruby-lex.rb#L381
     @tokens.each_with_index do |t, index|
       corresponding_token_depth = nil
       case t[1]
-      when :on_ignored_nl, :on_nl
+      when :on_ignored_nl, :on_nl, :on_comment
         spaces_at_line_head = 0
         is_first_spaces_of_line = true
         is_first_printable_of_line = true
-- 
cgit v0.10.2


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

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