Irb cannot parse /\^/

e$B;3K$G$9!#e(B

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

e$B$NLdBj$J$N$G$9$,!"2<$N%Q%C%A$G<#$k$h$&$G$9!#$3$l$G4V0c$$$J$$$G$7$g$&$+!)e(B

[ruby-talk:181631] e$B$NJ}$Ke(B rdoc

e$B$NF1MM$NLdBj$,Js9p$5$l$F$?$N$G$9$,!"%Q%C%A$be(B

e$BA4$/F1$8$K$J$j$^$7$?!#%3!<%I$N=P=j$,F1$8!)e(B

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)

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In [ruby-dev:28404] the message: “[ruby-dev:28404] irb cannot parse
/^/”, on Feb/27 21:19(JST) H.Yamamoto [email protected] writes:

e$B;3K$G$9!#e(B

e$B$NLdBj$J$N$G$9$,!"2<$N%Q%C%A$G<#$k$h$&$G$9!#$3$l$G4V0c$$$J$$$G$7$g$&e(B
e$B$+!)e(B

e$B$^$@e(B, e$B$A$c$s$H3NG’$7$F$$$^$;$s$,e(B,
e$BA0H>$O$=$N$H$*$j$N5$$,$7$F$$$^$9e(B.
e$B:G8e$Ne(B:

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)

e$B$NItJ,$G$9$,e(B, e$B860x$OJL$K$"$j$=$&e(B.

Rubye$B$G$Oe(B,

“^C”

e$B$H$+$,0JA0$O5v$5$l$F$$$?$H;W$&$s$G$9$,e(B,
e$B$$$^$O5v$5$l$F$$$J$$e(B?

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

e$B;3K$G$9!#e(B

read_escape
end
if PERCENT_PAREN.values.include?(@quoted)

e$B$NItJ,$G$9$,e(B, e$B860x$OJL$K$"$j$=$&e(B.

Rubye$B$G$Oe(B,

“^C”

e$B$H$+$,0JA0$O5v$5$l$F$$$?$H;W$&$s$G$9$,e(B, e$B$$$^$O5v$5$l$F$$$J$$e(B?

e$B$`!"$=$&$$$&>l9g$Oe(B @ltype e$B$,e(B “”"
e$B$K$J$k$s$8$c$J$$$+$H;W$$$^$9!#e(B

e$B$3$N%Q%C%A$O!"@55,I=8=$H%7%s%0%k%/%*!<%HJ8;zNs$NCf$G%(%9%1!<%W=hM}$re(B

e$BL58z$K$9$k$3$H$r0U?^$7$F$$$^$9!#$H$$$C$F$b!"$3$N%Q%C%A$GK\Ev$Ke(B

e$B$=$&$G$-$F$$$k$+<+?.$,$J$$$N$G$9$,!J4@!Ke(B

e$B;3K$G$9!#e(B

e$B$$$(e(B, irb(rubye$B$be(B) e$BJ8;zNs$b@55,I=8=$bF1$8$h$&$K=hM}$5$l$F$$$^$9e(B. e$B%(%9%1!<e(B
e$B%W;EJ}$bF1$8$K$J$C$F$$$^$9e(B. e$B>/$J$/$H$be(Birbe$B$K4X$7$F$Oe(B, irbe$B$N:n<T$,8@$&$Ne(B
e$B$@$+$i4V0c$$$J$$$G$9e(B(^^;

e$B$9$_$^$;$s!"4*0c$$$G$7$?!J4@!Ke(B

irb(main):020:0> /\t/ =~ “\t”
=> 0

e$B$^$9e(B.

e$B$?$V$se(B, e$B$3$N%P%0$Oe(Brubye$B$K$bEv;~$O$"$C$?$N$G$O$J$$$+$He(B…

e$B$=$l$Oe(B, e$B$H$b$+$/$H$7$Fe(B, ^C e$B$N$h$&$J%(%9%1!<%W$Oe(Brubye$B$G5v$5$l$J$/$J$C$Fe(B
e$B$$$k$N$Ge(B, irbe$B$bF1MM$K$9$l$Pe(B, e$B$3$N%P%0$O$J$/$J$j$^$9e(B.

e$B$*G$$;$7$^$9!#e(B

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In [ruby-dev:28406] the message: “[ruby-dev:28406] Re: irb cannot
parse /^/”, on Feb/27 22:37(JST) H.Yamamoto [email protected]
writes:

e$B;3K$G$9!#e(B

Rubye$B$G$Oe(B,
“^C”
e$B$H$+$,0JA0$O5v$5$l$F$$$?$H;W$&$s$G$9$,e(B, e$B$$$^$O5v$5$l$F$$$J$$e(B?

e$B$`!"$=$&$$$&>l9g$Oe(B @ltype e$B$,e(B “"” e$B$K$J$k$s$8$c$J$$$+$H;W$$$^$9!#e(B

e$B$$$(e(B, irb(rubye$B$be(B)
e$BJ8;zNs$b@55,I=8=$bF1$8$h$&$K=hM}$5$l$F$$$^$9e(B. e$B%(%9%1!<e(B
e$B%W;EJ}$bF1$8$K$J$C$F$$$^$9e(B. e$B>/$J$/$H$be(Birbe$B$K4X$7$F$Oe(B,
irbe$B$N:n<T$,8@$&$Ne(B
e$B$@$+$i4V0c$$$J$$$G$9e(B(^^;

e$B$b$&e(B, e$B2a5n$N$3$H$J$N$G$9$,e(B, e$B0JA0$Ne(Brubye$B$G$Oe(B,

^C

e$B$G%3%s%H%m!<%kJ8;z$N%(%9%1!<%W$,$G$-$k$h$&$K$J$C$F$$$?e(B,
e$B$=$l$r$^$M$Fe(B
irbe$B$b:n$j$^$7$?e(B. e$B$=$N$&$Ae(B, rubye$B$NJ}$G$Oe(B,

^C

e$B$,$r5v$5$l$J$/$J$C$?$s$@$1$I$be(B,
irbe$B$O$=$N$^$^$@$C$?$H$$$&$3$H$@$H;W$$e(B
e$B$^$9e(B.

e$B$?$V$se(B,

e$B$3$N%P%0$Oe(Brubye$B$K$bEv;~$O$"$C$?$N$G$O$J$$$+$He(B…

e$B$=$l$Oe(B, e$B$H$b$+$/$H$7$Fe(B, ^C
e$B$N$h$&$J%(%9%1!<%W$Oe(Brubye$B$G5v$5$l$J$/$J$C$Fe(B
e$B$$$k$N$Ge(B, irbe$B$bF1MM$K$9$l$Pe(B, e$B$3$N%P%0$O$J$/$J$j$^$9e(B.

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

e$B;3K$G$9!#e(B

e$B$9$_$^$;$s!"4*0c$$$G$7$?!J4@!Ke(B
irb(main):020:0> /\t/ =~ “\t”
=> 0

e$B$3$l$G$Oe(B, e$B3NG’$K$O$J$C$F$$$J$$$h$&$J5$$,$7$^$9$,e(B…

e$B$9$_$^$;$s!J4@!Ke(B

e$B$=$l$O$H$b$+$/e(B, e$BJs9p$"$j$,$H$&$4$6$$$^$7$?e(B.

e$B$=$l$Oe(B, e$B$H$b$+$/$H$7$Fe(B, ^C e$B$N$h$&$J%(%9%1!<%W$Oe(Brubye$B$G5v$5$l$J$/$J$C$Fe(B
e$B$$$k$N$Ge(B, irbe$B$bF1MM$K$9$l$Pe(B, e$B$3$N%P%0$O$J$/$J$j$^$9e(B.

e$B$*G$$;$7$^$9!#e(B

e$B$H$j$"$($:e(B, CVS/HEAD e$B$NJ}$rD>$7$^$7$?e(B. 1.8e$B7O$O$b$&$A$g$C$H$?$C$F$+$iD>e(B
e$B$7$^$9e(B.

e$BF1$8%Q%C%A$rEv$F$k$3$H$Ge(B ruby-talk e$B$GJs9p$5$l$?e(B rdoc
e$B$N%P%0$be(B
e$BD>$j$^$7$?!#$3$A$i$O;d$N$[$&$G%3%_%C%H$7$F$*$-$^$9!#e(B

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In [ruby-dev:28411] the message: “[ruby-dev:28411] Re: irb cannot
parse /^/”, on Mar/01 00:14(JST) H.Yamamoto [email protected]
writes:

e$B;3K$G$9!#e(B

e$BF1$8%Q%C%A$rEv$F$k$3$H$Ge(B ruby-talk e$B$GJs9p$5$l$?e(B rdoc e$B$N%P%0$be(B
e$BD>$j$^$7$?!#$3$A$i$O;d$N$[$&$G%3%_%C%H$7$F$*$-$^$9!#e(B

e$BN;2r$G$9e(B.
e$B$C$Fe(B, e$B;d$,8@$&$3$H$G$O$J$$$Je(B.

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In [ruby-dev:28408] the message: “[ruby-dev:28408] Re: irb cannot
parse /^/”, on Feb/27 23:15(JST) H.Yamamoto [email protected]
writes:

e$B;3K$G$9!#e(B

e$B$9$_$^$;$s!"4*0c$$$G$7$?!J4@!Ke(B
irb(main):020:0> /\t/ =~ “\t”
=> 0

e$B$3$l$G$Oe(B, e$B3NG’$K$O$J$C$F$$$J$$$h$&$J5$$,$7$^$9$,e(B…

e$B$=$l$O$H$b$+$/e(B, e$BJs9p$"$j$,$H$&$4$6$$$^$7$?e(B.

e$B$=$l$Oe(B, e$B$H$b$+$/$H$7$Fe(B, ^C e$B$N$h$&$J%(%9%1!<%W$Oe(Brubye$B$G5v$5$l$J$/$J$C$Fe(B
e$B$$$k$N$Ge(B, irbe$B$bF1MM$K$9$l$Pe(B, e$B$3$N%P%0$O$J$/$J$j$^$9e(B.

e$B$*G$$;$7$^$9!#e(B

e$B$H$j$"$($:e(B, CVS/HEAD e$B$NJ}$rD>$7$^$7$?e(B.
1.8e$B7O$O$b$&$A$g$C$H$?$C$F$+$iD>e(B
e$B$7$^$9e(B.

Index: lib/irb/ruby-lex.rb

RCS file: /src/ruby/lib/irb/ruby-lex.rb,v
retrieving revision 1.28
diff -u -r1.28 ruby-lex.rb
— lib/irb/ruby-lex.rb 30 Jun 2005 10:07:29 -0000 1.28
+++ lib/irb/ruby-lex.rb 28 Feb 2006 13:39:47 -0000
@@ -309,7 +309,7 @@
“q” => “'”,
“Q” => “"”,
“x” => “`”,

  • “r” => “/”,
  • “r” => “/”,
    “w” => “]”,
    “W” => “]”,
    “s” => “:”
    @@ -326,14 +326,14 @@
    “'” => TkSTRING,
    “"” => TkSTRING,
    “`” => TkXSTRING,
  • “/” => TkREGEXP,
  • “/” => TkREGEXP,
    “]” => TkDSTRING,
    “:” => TkSYMBOL
    }
    DLtype2Token = {
    “"” => TkDSTRING,
    “`” => TkDXSTRING,
  • “/” => TkDREGEXP,
  • “/” => TkDREGEXP,
    }

def lex_init()
@@ -1087,7 +1087,7 @@
def read_escape
case ch = getc
when “\n”, “\r”, “\f”

  • when “\”, “n”, “t”, “r”, “f”, “v”, “a”, “e”, “b” #"
  • when “\”, “n”, “t”, “r”, “f”, “v”, “a”, “e”, “b”, “s” #"
    when /[0-7]/
    ungetc ch
    3.times do
    @@ -1122,7 +1122,7 @@
    end
    end
  • when “C”, “c”, “^”
  • when “C”, “c” #, “^”
    if ch == “C” and (ch = getc) != “-”
    ungetc
    elsif (ch = getc) == “\” #"

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—