Sha256: d3aaec26d79b9df1aa4c80c6269aa2001149f2d7cdab3471cd5b79f6ac0b8921

Contents?: true

Size: 940 Bytes

Versions: 6

Compression:

Stored size: 940 Bytes

Contents

module Byebug
  #
  # Implements the continue command.
  #
  # Allows the user to continue execution until the next stopping point, a
  # specific line number or until program termination.
  #
  class ContinueCommand < Command
    def regexp
      /^\s* c(?:ont(?:inue)?)? (?:\s+(\S+))? \s*$/x
    end

    def execute
      if @match[1]
        num, err = get_int(@match[1], 'Continue', 0, nil)
        return errmsg(err) unless num

        filename = File.expand_path(@state.file)
        unless LineCache.trace_line_numbers(filename).member?(num)
          return errmsg("Line #{num} is not a valid stopping point in file")
        end

        Breakpoint.add(filename, num)
      end

      @state.proceed
    end

    class << self
      def names
        %w(continue)
      end

      def description
        %(c[ont[inue]][ <n>]

          Run until program ends, hits a breakpoint or reaches line <n>.)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
byebug-3.5.1 lib/byebug/commands/continue.rb
byebug-3.5.0 lib/byebug/commands/continue.rb
byebug-3.4.2 lib/byebug/commands/continue.rb
byebug-3.4.1 lib/byebug/commands/continue.rb
byebug-3.4.0 lib/byebug/commands/continue.rb
byebug-3.3.0 lib/byebug/commands/continue.rb