Sha256: 8835b3b099a1c94566c29878e702c3e32af6cb0c50bc6af50c86185a4597bb0f

Contents?: true

Size: 469 Bytes

Versions: 34

Compression:

Stored size: 469 Bytes

Contents

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

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
steep-0.10.0 lib/steep/ast/types/helper.rb
steep-0.9.0 lib/steep/ast/types/helper.rb
steep-0.8.2 lib/steep/ast/types/helper.rb
steep-0.8.1 lib/steep/ast/types/helper.rb
steep-0.8.0 lib/steep/ast/types/helper.rb
steep-0.7.1 lib/steep/ast/types/helper.rb
steep-0.7.0 lib/steep/ast/types/helper.rb
steep-0.6.0 lib/steep/ast/types/helper.rb
steep-0.5.1 lib/steep/ast/types/helper.rb
steep-0.5.0 lib/steep/ast/types/helper.rb
steep-0.4.0 lib/steep/ast/types/helper.rb
steep-0.3.0 lib/steep/ast/types/helper.rb
steep-0.2.0 lib/steep/ast/types/helper.rb
steep-0.1.0 lib/steep/ast/types/helper.rb