Sha256: 097cd2ada679b5af16f9ae77059efa03f3cced5892e68134796c5b638c3e56c6

Contents?: true

Size: 636 Bytes

Versions: 1

Compression:

Stored size: 636 Bytes

Contents

require 'gobstones/runner/execution_context'

module Gobstones

  module Lang

    class Program

      attr_reader :definitions, :main_definition

      def initialize(definitions, main_definition)
        @definitions = definitions
        @main_definition = main_definition
      end

      def ==(other)
        self.class == other.class &&
        self.definitions == other.definitions &&
        self.main_definition == other.main_definition
      end

      def evaluate
        context = Gobstones::Runner::ProgramExecutionContext.for self
        main_definition.evaluate context
        context
      end

    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gobstones-0.0.1.1 lib/gobstones/lang/program.rb