def _rl_find_completion_word()
_end = @rl_point
found_quote = 0
delimiter = 0.chr
quote_char = 0.chr
brkchars = nil
if @rl_completion_word_break_hook
brkchars = send(@rl_completion_word_break_hook)
end
if brkchars.nil?
brkchars = @rl_completer_word_break_characters
end
if (@rl_completer_quote_characters)
scan = 0
pass_next = false
while scan < _end
if !@rl_byte_oriented
scan = _rl_find_next_mbchar(@rl_line_buffer, scan, 1, MB_FIND_ANY)
else
scan += 1
end
if (pass_next)
pass_next = false
next
end
if (quote_char != "'" && @rl_line_buffer[scan,1] == "\\")
pass_next = true
found_quote |= RL_QF_BACKSLASH
next
end
if (quote_char != 0.chr)
if (@rl_line_buffer[scan,1] == quote_char)
quote_char = 0.chr
@rl_point = _end
end
elsif (@rl_completer_quote_characters.include?(@rl_line_buffer[scan,1]))
quote_char = @rl_line_buffer[scan,1]
@rl_point = scan + 1
if (quote_char == "'")
found_quote |= RL_QF_SINGLE_QUOTE
elsif (quote_char == '"')
found_quote |= RL_QF_DOUBLE_QUOTE
else
found_quote |= RL_QF_OTHER_QUOTE
end
end
end
end
if (@rl_point == _end && quote_char == 0.chr)
while (@rl_point = !@rl_byte_oriented ?
_rl_find_prev_mbchar(@rl_line_buffer, @rl_point, MB_FIND_ANY):(@rl_point-1))>0
scan = @rl_line_buffer[@rl_point,1]
if !brkchars.include?(scan)
next
end
if (@rl_char_is_quoted_p && found_quote!=0 &&
send(@rl_char_is_quoted_p,@rl_line_buffer, @rl_point))
next
end
break
end
end
scan = @rl_line_buffer[@rl_point,1]
if (scan != 0.chr)
if (@rl_char_is_quoted_p)
isbrk = (found_quote == 0 ||
!send(@rl_char_is_quoted_p,@rl_line_buffer, @rl_point)) &&
brkchars.include?(scan)
else
isbrk = brkchars.include?(scan)
end
if (isbrk)
if (@rl_basic_quote_characters &&
@rl_basic_quote_characters.include?(scan) &&
(_end - @rl_point) > 1)
delimiter = scan
end
if (@rl_special_prefixes.nil? || !@rl_special_prefixes.include?(scan) )
@rl_point+=1
end
end
end
return [quote_char,found_quote!=0,delimiter]
end