Sha256: 3ec3a856a6ea48859956b3902302c30dea4b1ce406e5e9e7ecc0ffe2c0780a5d

Contents?: true

Size: 441 Bytes

Versions: 9

Compression:

Stored size: 441 Bytes

Contents

module DeepCover
  class Node::EmptyBody < Node
    def initialize(base_node, parent: raise, index: 0, position: ChildCanBeEmpty.last_empty_position)
      @position = position
      super(base_node, parent: parent, index: index, base_children: [])
    end

    def type
      :EmptyBody
    end

    def loc_hash
      return {} if @position == true
      {expression: @position}
    end

    def is_statement
      false
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
deep-cover-0.1.10 lib/deep_cover/node/empty_body.rb
deep-cover-0.1.9 lib/deep_cover/node/empty_body.rb
deep-cover-0.1.8 lib/deep_cover/node/empty_body.rb
deep-cover-0.1.7 lib/deep_cover/node/empty_body.rb
deep-cover-0.1.6 lib/deep_cover/node/empty_body.rb
deep-cover-0.1.5 lib/deep_cover/node/empty_body.rb
deep-cover-0.1.4 lib/deep_cover/node/empty_body.rb
deep-cover-0.1.3 lib/deep_cover/node/empty_body.rb
deep-cover-0.1.2 lib/deep_cover/node/empty_body.rb