Sha256: d25b60bc9ba967f8cb24dedd8f2bad524056c3901f46104198fc3d3d588307ec

Contents?: true

Size: 920 Bytes

Versions: 60

Compression:

Stored size: 920 Bytes

Contents

module Debugger

  # Implements debugger "set_type" command
  class SetTypeCommand < Command
    self.need_context = true

    def regexp
      / ^\s*
         set_type? \s*
         (?:\s+(\S+))?\s*
         (?:\s+(\S+))?\s*
         $
      /ix
    end

    def execute
      if RUBY_VERSION < "1.9"
        print_msg "Not implemented"
        return
      end
      begin
        expr = @match[1] + " = " + @match[2] + "(" + @match[1] + ".inspect)"
        eval(expr)
      rescue
        begin
          expr = @match[1] + " = " + @match[2] + ".new(" + @match[1] + ".inspect)"
          eval(expr)
        rescue nil
        end
      end
    end

    class << self
      def help_command
        %w[set_type]
      end

      def help(cmd)
        %{
          set_type <var> <type>

          Change the type of <var> to <type>
         }
      end
    end
  end
end

Version data entries

60 entries across 52 versions & 5 rubygems

Version Path
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.3/lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide22-0.7.5 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide22-0.7.4 lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/ruby-debug-ide-0.7.3/lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.7.3 lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.1.4 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/commands/set_type.rb
tdiary-5.1.3 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.2/lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.7.2 lib/ruby-debug-ide/commands/set_type.rb
ruby-debug-ide-0.7.1.beta3 lib/ruby-debug-ide/commands/set_type.rb