Sha256: d94abc9b1083ca4c09523896053130c1dafd894471f886f87aa7b7aa431779c6

Contents?: true

Size: 957 Bytes

Versions: 2

Compression:

Stored size: 957 Bytes

Contents

require 'byebug/command'
require 'byebug/helpers/parse'

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
    include Helpers::ParseHelper

    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 Breakpoint.potential_line?(filename, num)
          return errmsg(pr('continue.errors.unstopped_line', line: num))
        end

        Breakpoint.add(filename, num)
      end

      @state.proceed
    end

    def description
      <<-EOD
        c[ont[inue]][ <n>]

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

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/byebug-5.0.0/lib/byebug/commands/continue.rb
byebug-5.0.0 lib/byebug/commands/continue.rb