Sha256: 6a76d7f7e75c548678ff9585769ea70019ec874d699c182b49782d1ea7b4cc33

Contents?: true

Size: 364 Bytes

Versions: 3

Compression:

Stored size: 364 Bytes

Contents

# frozen_string_literal: true

require_relative 'statement'

module Basic101

  class GotoStatement < Statement

    def initialize(target_line_number)
      @target_line_number = target_line_number
    end

    def execute(runtime)
      runtime.goto_line(@target_line_number)
    end

    protected

    def state
      [@target_line_number]
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
basic101-1.0.2 lib/basic101/goto_statement.rb
basic101-1.0.1 lib/basic101/goto_statement.rb
basic101-1.0.0 lib/basic101/goto_statement.rb