problem with irb

G

gabriele renzi

Hi gurus and nubys,

it is normal that IRB in latest pragprog is:


C:\Documents and Settings\gabriele>irb -v
irb 0.9(02/07/03)

if that is true and I've not messed up something,

this happens to me:

irb(main):001:0> %s.#{boom}.
C:/Programmi/Ruby/lib/ruby/1.8/irb/ruby-token.rb:101:in `Token':
undefined metho
d `ancestors' for nil:NilClass (NoMethodError)
from C:/Programmi/Ruby/lib/ruby/1.8/irb/ruby-lex.rb:995:in
`identify_str
ing'
from C:/Programmi/Ruby/lib/ruby/1.8/irb/ruby-lex.rb:914:in
`identify_quo
tation'
from C:/Programmi/Ruby/lib/ruby/1.8/irb/ruby-lex.rb:667:in
`lex_int2'
from C:/Programmi/Ruby/lib/ruby/1.8/irb/ruby-lex.rb:664:in
`call'
from C:/Programmi/Ruby/lib/ruby/1.8/irb/slex.rb:234:in
`match_io'
from C:/Programmi/Ruby/lib/ruby/1.8/irb/slex.rb:219:in
`match_io'
from C:/Programmi/Ruby/lib/ruby/1.8/irb/slex.rb:73:in `match'
from C:/Programmi/Ruby/lib/ruby/1.8/irb/ruby-lex.rb:277:in
`token'
... 7 levels...
from C:/Programmi/Ruby/lib/ruby/1.8/irb.rb:70:in `start'
from C:/Programmi/Ruby/lib/ruby/1.8/irb.rb:69:in `catch'
from C:/Programmi/Ruby/lib/ruby/1.8/irb.rb:69:in `start'
from ./irb:13


ruby -v says
ruby 1.8.1 (2003-12-25) [i386-mswin32]

running on windows xp pro
 
N

nobu.nokada

Hi,

At Tue, 20 Apr 2004 20:19:09 +0900,
gabriele renzi wrote in [ruby-talk:97677]:
Hi gurus and nubys,

it is normal that IRB in latest pragprog is:


C:\Documents and Settings\gabriele>irb -v
irb 0.9(02/07/03)

if that is true and I've not messed up something,

Try this patch.


Index: lib/irb/ruby-lex.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/irb/ruby-lex.rb,v
retrieving revision 1.22
diff -U2 -p -d -r1.22 ruby-lex.rb
--- lib/irb/ruby-lex.rb 4 Oct 2003 17:51:09 -0000 1.22
+++ lib/irb/ruby-lex.rb 20 Apr 2004 11:47:05 -0000
@@ -974,5 +974,5 @@ class RubyLex
if @quoted == ch and nest == 0
break
- elsif @ltype != "'" && @ltype != "]" and ch == "#"
+ elsif ! "']:".index(@ltype) and ch == "#"
subtype = true
elsif ch == '\\' #'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top