Class: Carbon::Compiler::Node::EType::Option

Inherits:
Base
  • Object
show all
Defined in:
lib/carbon/compiler/node/etype/option.rb

Instance Attribute Summary

Attributes inherited from Base

#children, #location

Instance Method Summary collapse

Methods inherited from Base

#[], #accept, #attributes!, #behavior?, #data, #data?, #each, #identity?, #initialize, #map!, mapping, #merge!, #type!, #update!

Constructor Details

This class inherits a constructor from Carbon::Compiler::Node::Base

Instance Method Details

#expand(file) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/carbon/compiler/node/etype/option.rb', line 9

def expand(file)
  children.map do |child|
    # child.is_a?(Node::EType) # => true
    if child.clean?
      type = child.to_type
      last = type.name.parts.last
      { last => type.name.parts }
    else
      child.expand(file, false)
    end
  end.inject(:merge)
end