Class: CodeTools::AST::ToplevelModuleName

Inherits:
ModuleName show all
Defined in:
lib/rubinius/code/ast/definitions.rb

Instance Attribute Summary

Attributes inherited from ModuleName

#name

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from ModuleName

#name_bytecode

Methods inherited from Node

#ascii_graph, #attributes, #children, #defined, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, #or_bytecode, #pos, #set_child, #transform, transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk

Constructor Details

#initialize(line, node) ⇒ ToplevelModuleName

Returns a new instance of ToplevelModuleName.



1028
1029
1030
1031
# File 'lib/rubinius/code/ast/definitions.rb', line 1028

def initialize(line, node)
  @line = line
  @name = node.name
end

Instance Method Details

#bytecode(g) ⇒ Object



1033
1034
1035
1036
1037
1038
1039
# File 'lib/rubinius/code/ast/definitions.rb', line 1033

def bytecode(g)
  pos(g)

  name_bytecode(g)
  g.push_cpath_top
  g.send :open_module_under, 2
end

#to_sexpObject



1041
1042
1043
# File 'lib/rubinius/code/ast/definitions.rb', line 1041

def to_sexp
  [:colon3, @name]
end