[#28337] constant look up order in CVS HEAD — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

15 messages 2006/02/18
[#28338] Re: constant look up order in CVS HEAD — Tanaka Akira <akr@...17n.org> 2006/02/19

In article <1140229116.805371.31930.nullmailer@x31.priv.netlab.jp>,

[#28341] Re: constant look up order in CVS HEAD — GOTOU Yuuzou <gotoyuzo@...> 2006/02/19

In message <87lkw8xfay.fsf@m17n.org>,

[#28342] Re: constant look up order in CVS HEAD — Yukihiro Matsumoto <matz@...> 2006/02/19

まつもと ゆきひろです

[ruby-dev:28404] irb cannot parse /\^/

From: "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Date: 2006-02-27 12:19:49 UTC
List: ruby-dev #28404
山本です。

http://rubyforge.org/tracker/index.php?func=detail&aid=3302&group_id=426&atid=1698

の問題なのですが、下のパッチで治るようです。これで間違いないでしょうか?

# [ruby-talk:181631] の方に rdoc の同様の問題が報告されてたのですが、パッチも
# 全く同じになりました。コードの出所が同じ?

Index: ruby-lex.rb
===================================================================
RCS file: /src/ruby/lib/irb/ruby-lex.rb,v
retrieving revision 1.28
diff -u -w -b -p -r1.28 ruby-lex.rb
--- ruby-lex.rb	30 Jun 2005 10:07:29 -0000	1.28
+++ ruby-lex.rb	27 Feb 2006 12:10:40 -0000
@@ -309,7 +309,7 @@ class RubyLex
     "q" => "\'",
     "Q" => "\"",
     "x" => "\`",
-    "r" => "\/",
+    "r" => "/",
     "w" => "]",
     "W" => "]",
     "s" => ":"
@@ -326,14 +326,14 @@ class RubyLex
     "\'" => TkSTRING,
     "\"" => TkSTRING,
     "\`" => TkXSTRING,
-    "\/" => TkREGEXP,
+    "/" => TkREGEXP,
     "]" => TkDSTRING,
     ":" => TkSYMBOL
   }
   DLtype2Token = {
     "\"" => TkDSTRING,
     "\`" => TkDXSTRING,
-    "\/" => TkDREGEXP,
+    "/" => TkDREGEXP,
   }
 
   def lex_init()
@@ -1040,7 +1040,7 @@ class RubyLex
 	  break
 	elsif @ltype != "'" && @ltype != "]" && @ltype != ":" and ch == "#"
 	  subtype = true
-	elsif ch == '\\' #'
+	elsif @ltype != "'" && @ltype != "/" and ch == '\\' #'
 	  read_escape
 	end
 	if PERCENT_PAREN.values.include?(@quoted) 



In This Thread

Prev Next