Class: Carbon::Compiler::Node::Name

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

Overview

The root node. This is the topmost level node, and includes all declarations, definitions, and directives.

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

#inspect::String

Fancy inspection.

Returns:

  • (::String)


21
22
23
# File 'lib/carbon/compiler/node/name.rb', line 21

def inspect
  "#(Name #{value})"
end

#value::String

The value of the name. This is a string representation of the name.

Returns:

  • (::String)


14
15
16
# File 'lib/carbon/compiler/node/name.rb', line 14

def value
  @children[0].value
end