2 # xmp.rb - irb version of gotoken xmp
3 # $Release Version: 0.9$
5 # $Date: 2007-02-12 15:01:19 -0800 (Mon, 12 Feb 2007) $
6 # by Keiju ISHITSUKA(Nippon Rational Inc.)
17 @RCS_ID='-$Id: xmp.rb 11708 2007-02-12 23:01:19Z shyouhei $-'
19 def initialize(bind = nil)
24 IRB.conf[:PROMPT_MODE] = :XMP
26 bind = IRB::Frame.top(1) unless bind
27 ws = IRB::WorkSpace.new(bind)
28 @io = StringInputMethod.new
29 @irb = IRB::Irb.new(ws, @io)
30 @irb.context.ignore_sigint = false
32 # IRB.conf[:IRB_RC].call(@irb.context) if IRB.conf[:IRB_RC]
33 IRB.conf[:MAIN_CONTEXT] = @irb.context
39 if @irb.context.ignore_sigint
41 trap_proc_b = trap("SIGINT"){@irb.signal_handle}
46 trap("SIGINT", trap_proc_b)
55 class StringInputMethod < IRB::InputMethod
76 @exps.concat exps.split(/\n/)
81 def xmp(exps, bind = nil)
82 bind = IRB::Frame.top(1) unless bind