Sha256: aba60d0805d5ccaa93cd06ca382cec7faafa0841700bbb1bb6b2fb010af91d6c

Contents?: true

Size: 666 Bytes

Versions: 5

Compression:

Stored size: 666 Bytes

Contents

require_relative "./node"

module Dentaku
  module AST
    class Array < Node
      def self.arity
      end

      def self.min_param_count
        0
      end

      def self.max_param_count
        Float::INFINITY
      end

      def self.peek(*)
      end

      def initialize(*elements)
        @elements = *elements
      end

      def value(context = {})
        @elements.map { |el| el.value(context) }
      end

      def dependencies(context = {})
        @elements.flat_map { |el| el.dependencies(context) }
      end

      def type
        nil
      end
      
      def accept(visitor)
        visitor.visit_array(self)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
dentaku-3.5.3 lib/dentaku/ast/array.rb
dentaku-3.5.2 lib/dentaku/ast/array.rb
dentaku_zevo-3.5.2 lib/dentaku/ast/array.rb
dentaku-3.5.1 lib/dentaku/ast/array.rb
dentaku-3.5.0 lib/dentaku/ast/array.rb