method
match_io
v1_9_1_378 -
Show latest stable
- Class:
IRB::SLex::Node
match_io(io, op = "")public
No documentation available.
# File lib/irb/slex.rb, line 203
def match_io(io, op = "")
if op == ""
ch = io.getc
if ch == nil
return nil
end
else
ch = io.getc_of_rests
end
if ch.nil?
if @preproc.nil? || @preproc.call(op, io)
D_DETAIL.printf("op1: %s\n", op)
@postproc.call(op, io)
else
nil
end
else
if node = @Tree[ch]
if ret = node.match_io(io, op+ch)
ret
else
io.ungetc ch
if @postproc and @preproc.nil? || @preproc.call(op, io)
DOUT.exec_if{D_DETAIL.printf "op2: %s\n", op.inspect}
@postproc.call(op, io)
else
nil
end
end
else
io.ungetc ch
if @postproc and @preproc.nil? || @preproc.call(op, io)
D_DETAIL.printf("op3: %s\n", op)
@postproc.call(op, io)
else
nil
end
end
end
end