Imported File#ftype spec from rubyspecs.
[rbx.git] / lib / irb / rubinius.rb
blob0bf13652560a9c2bee4d3e1ae000a5deb9476168
1 module IRB
2   class IrbRubinius < Irb
3     def process_statements
4       @scanner.each_top_level_statement do |line, line_no|
5         signal_status(:IN_EVAL) do
6           begin
7             line.untaint
8             @context.evaluate(line, line_no)
9             output_value if @context.echo?
10           rescue SystemExit, ThrownValue => e
11             $! = e
12           rescue Object => e
13             
14             puts "#{e.class}: #{e.message}"
15             
16             bt = e.awesome_backtrace
18             continue = true
19             bt.frames.each do |frame|
20               next unless continue
21               recv = frame.describe
22               loc = frame.location
23               if %r!kernel/core/eval.rb!.match(loc)
24                 continue = false
25                 next
26               end
27               
28               if %r!main.irb_binding!.match(recv)
29                 puts "   from #{recv}"
30                 break
31               end
32               
33               puts "   from #{recv} at #{loc}"
34             end            
35           end
36         end
37       end
38     end
39   end
40 end
42 IRB.conf[:IRB_CLASS] = IRB::IrbRubinius