Class: Byebug::NextCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/byebug/commands/stepping.rb

Overview

Implements the next functionality.

Allows the user the continue execution until the next instruction in the current frame.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



44
45
46
47
48
49
50
# File 'lib/byebug/commands/stepping.rb', line 44

def description
  %(n[ext][+-]?[ nnn]

  Steps over once or nnn times.
    '+' forces to move to another line.
    '-' is the opposite of '+' and disables the :forcestep setting.)
end

.namesObject



40
41
42
# File 'lib/byebug/commands/stepping.rb', line 40

def names
  %w(next)
end

Instance Method Details

#executeObject



31
32
33
34
35
36
37
# File 'lib/byebug/commands/stepping.rb', line 31

def execute
  steps, err = parse_steps(@match[2], 'Next')
  return errmsg(err) unless steps

  @state.context.step_over(steps, @state.frame_pos, parse_force(@match[1]))
  @state.proceed
end

#regexpObject



27
28
29
# File 'lib/byebug/commands/stepping.rb', line 27

def regexp
  /^\s* n(?:ext)?([+-])? (?:\s+(\S+))? \s*$/x
end