Sha256: 51dc9e860c6981815d0987d540ea1bf4017c1fbcbae727651d7947afd91df67a

Contents?: true

Size: 429 Bytes

Versions: 21

Compression:

Stored size: 429 Bytes

Contents

class Code
  class Node
    class Code < Node
      def initialize(parsed)
        @statements = parsed.map { |statement| Node::Statement.new(statement) }
      end

      def evaluate(**args)
        last = ::Code::Object::Nothing.new

        @statements.each do |statement|
          last =
            statement.evaluate(**args.merge(object: ::Code::Object::Global.new))
        end

        last
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
template-ruby-0.5.6 lib/code/node/code.rb
language-ruby-0.5.6 lib/code/node/code.rb
code-ruby-0.5.6 lib/code/node/code.rb
template-ruby-0.5.5 lib/code/node/code.rb
language-ruby-0.5.5 lib/code/node/code.rb
code-ruby-0.5.5 lib/code/node/code.rb
template-ruby-0.5.4 lib/code/node/code.rb
language-ruby-0.5.4 lib/code/node/code.rb
code-ruby-0.5.4 lib/code/node/code.rb
template-ruby-0.5.3 lib/code/node/code.rb
language-ruby-0.5.3 lib/code/node/code.rb
code-ruby-0.5.3 lib/code/node/code.rb
template-ruby-0.5.2 lib/code/node/code.rb
language-ruby-0.5.2 lib/code/node/code.rb
code-ruby-0.5.2 lib/code/node/code.rb
language-ruby-0.5.1 lib/code/node/code.rb
template-ruby-0.5.1 lib/code/node/code.rb
code-ruby-0.5.1 lib/code/node/code.rb
template-ruby-0.5.0 lib/code/node/code.rb
language-ruby-0.5.0 lib/code/node/code.rb