Sha256: 0db431db91ef2d58e6f8400e64474e1908d7186a75431e399037c5bb75154b73

Contents?: true

Size: 803 Bytes

Versions: 27

Compression:

Stored size: 803 Bytes

Contents

module Steep
  module AST
    module Types
      module Helper
        module ChildrenLevel
          def level_of_children(children)
            levels = children.map(&:level)
            children.map(&:level).sort {|a, b| (b.size <=> a.size) || 0 }.inject() do |a, b|
              a.zip(b).map do |x, y|
                if x && y
                  x + y
                else
                  x || y || raise
                end
              end
            end || []
          end
        end

        module NoFreeVariables
          def free_variables()
            @fvs ||= Set.new
          end
        end

        module NoChild
          def each_child(&block)
            unless block
              enum_for :each_child
            end
          end
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
steep-1.4.0.dev.3 lib/steep/ast/types/helper.rb
steep-1.3.2 lib/steep/ast/types/helper.rb
steep-1.3.1 lib/steep/ast/types/helper.rb
steep-1.4.0.dev.2 lib/steep/ast/types/helper.rb
steep-1.4.0.dev.1 lib/steep/ast/types/helper.rb
steep-1.3.0 lib/steep/ast/types/helper.rb
steep-1.3.0.pre.2 lib/steep/ast/types/helper.rb