0
  5   ˆl–ß=¿Jõ4Ÿº‚ œP.\·ú˜´o�þB g ÙlNˆMˆÏÂƒh¹ÁÀ¿      1
  /   ˆ{‹„„-i[D<†ªoZƒ›Ù«Ã605_‘I|¥‰ÓMdœv ©ƒ†ü+=ÃÂ ]    ‹      Õ–moÚ0Çß÷Sx~±wpèž:Ri¨-E”iš¦©2±!V;²Œ~ú9˜¶éÓ(j_ ;“îîçœÂÑMgø½�¾¯¯Pÿëç«ná
À·F FþA³Z .záÄÚ¼0ŸÏ«óFUé	�Ø,m‚±ZÄ¶Ê,Ãä ,þ#(L8eÎ¢Ð
›rÒ•ŒÿBjŒ@M­Œ»÷Ÿ‰˜›Â·<ƒ8Ÿ¿&HÅx2ž)½89y1<:ÁÇtY`•&)¶(²;Îä.!èh™°p5	m‚f4ÙÆVå˜„"› £ã6+i`”Ry_�ˆ1F4µmü£Û¹ùét`“âmR”h>nãO�vïì¦aÒ£�®×\;Í9&WÔX”)&Æ‚³�â[/¾›F^qk‘[¡ä³b5V©É©c=t‰.«¼„ým6hüb2úçƒ‹Þ0êü”°"ÄsuÿñÝ0éSÍ¥E‘Ð<¶îÑŠÊ§ø(G&?{¢UÍZL‹	B´Vù c•2®Ë¨› ëõ¶\åeÕkõ£JT‚S·jG½býSy/Õ\–\¬P2’câí õª7Z‡ÇÜns¹G€<Y˜;ß]˜”ïEûÞŠdéoR^dûE‘«9×nQx»‹±çE¡Ýv4+Ž
LžÜ­1‡o¥ŸŒ¥Ö!,Í[YÛw‘™ŽV‡…Cxòßá;å3w–aâí. öÜGE v÷ $7˜”¯ßS[Þ^`u¯ayÁß^C¼     6   ˆl–Ãa¾”Ò~êqA
ãMÜ”Å£�þB gd–V]rµüÿÆƒh¹ÅÄÃ      1
  6   	ˆl–Ãa¾”Ò~êqA3p¸”Å£�þB gr2ð¥�òµüÿÇƒh¹ÆÅÄ      	online
  F   ˆl–ßi~””†»%�À¶¦-ÿ�þYe’¬Ü„u�•æåüÿÈ„!ßÇ_�uÐb&=LyZËcõÇÆ 3>    # frozen_string_literal: false
#
#   irb/completion.rb -
#   	$Release Version: 0.9$
#   	$Revision$
#   	by Keiju ISHITSUKA(keiju@ishitsuka.com)
#       From Original Idea of shugo@ruby-lang.org
#

require_relative 'ruby-lex'

module IRB
  module InputCompletor # :nodoc:


    # Set of reserved words used by Ruby, you should not use these for
    # constants or variables
    ReservedWords = %w[
      __ENCODING__ __LINE__ __FILE__
      BEGIN END
      alias and
      begin break
      case class
      def defined? do
      else elsif end ensure
      false for
      if in
      module
      next nil not
      or
      redo rescue retry return
      self super
      then true
      undef unless until
      when while
      yield
    ]

    BASIC_WORD_BREAK_CHARACTERS = " \t\n`><=;|&{("

    def self.absolute_path?(p) # TODO Remove this method after 2.6 EOL.
      if File.respond_to?(:absolute_path?)
        File.absolute_path?(p)
      else
        if File.absolute_path(p) == p
          true
        else
          false
        end
      end
    end

    def self.retrieve_gem_and_system_load_path
      gem_paths = Gem::Specification.latest_specs(true).map { |s|
        s.require_paths.map { |p|
          if absolute_path?(p)
            p
          else
            File.join(s.full_gem_path, p)
          end
        }
      }.flatten if defined?(Gem::Specification)
      (gem_paths.to_a | $LOAD_PATH).sort
    end

    def self.retrieve_files_to_require_from_load_path
      @@files_from_load_path ||=
        (
          shortest = []
          rest = retrieve_gem_and_system_load_path.each_with_object([]) { |path, result|
            begin
              names = Dir.glob("**/*.{rb,#{RbConfig::CONFIG['DLEXT']}}", base: path)
            rescue Errno::ENOENT
              nil
            end
            next if names.empty?
            names.map! { |n| n.sub(/\.(rb|#{RbConfig::CONFIG['DLEXT']})\z/, '') }.sort!
            shortest << names.shift
            result.concat(names)
          }
          shortest.sort! | rest
        )
    end

    def self.retrieve_files_to_require_relative_from_current_dir
      @@files_from_current_dir ||= Dir.glob("**/*.{rb,#{RbConfig::CONFIG['DLEXT']}}", base: '.').map { |path|
        path.sub(/\.(rb|#{RbConfig::CONFIG['DLEXT']})\z/, '')
      }
    end

    CompletionRequireProc = lambda { |target, preposing = nil, postposing = nil|
      if target =~ /\A(['"])([^'"]+)\Z/
        quote = $1
        actual_target = $2
      else
        return nil # It's not String literal
      end
      tokens = RubyLex.ripper_lex_without_warning(preposing.gsub(/\s*\z/, ''))
      tok = nil
      tokens.reverse_each do |t|
        unless [:on_lparen, :on_sp, :on_ignored_sp, :on_nl, :on_ignored_nl, :on_comment].include?(t.event)
          tok = t
          break
        end
      end
      result = []
      if tok && tok.event == :on_ident && tok.state == Ripper::EXPR_CMDARG
        case tok.tok
        when 'require'
          result = retrieve_files_to_require_from_load_path.select { |path|
            path.start_with?(actual_target)
  