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

ruby-changes:17669

From: nobu <ko1@a...>
Date: Wed, 3 Nov 2010 14:24:02 +0900 (JST)
Subject: [ruby-changes:17669] Ruby:r29678 (trunk): * lib/irb/ruby-lex.rb (RubyLex#identify_string): use charclass.

nobu	2010-11-03 14:23:56 +0900 (Wed, 03 Nov 2010)

  New Revision: 29678

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=29678

  Log:
    * lib/irb/ruby-lex.rb (RubyLex#identify_string): use charclass.

  Modified files:
    trunk/lib/irb/ruby-lex.rb

Index: lib/irb/ruby-lex.rb
===================================================================
--- lib/irb/ruby-lex.rb	(revision 29677)
+++ lib/irb/ruby-lex.rb	(revision 29678)
@@ -148,7 +148,7 @@
     end
     c = c2 unless c
     @rests.unshift c #c =
-      @seek -= 1
+    @seek -= 1
     if c == "\n"
       @line_no -= 1
       if idx = @readed.reverse.index("\n")
@@ -239,7 +239,7 @@
 	    end
 	  end
 	  if @line != "\n"
-      @line.force_encoding(@io.encoding)
+            @line.force_encoding(@io.encoding)
 	    yield @line, @exp_line_no
 	  end
 	  break unless l
@@ -1068,7 +1068,7 @@
 	end
       end
       if @ltype == "/"
-       while peek(0) =~ /i|m|x|o|e|s|u|n/
+        while /[imxoesun]/ =~ peek(0)
 	  getc
 	end
       end

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

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