Class: CodeTools::AST::ScopedModuleName

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

Instance Attribute Summary collapse

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) ⇒ ScopedModuleName

Returns a new instance of ScopedModuleName.



1000
1001
1002
1003
1004
# File 'lib/rubinius/code/ast/definitions.rb', line 1000

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

Instance Attribute Details

#parentObject

Returns the value of attribute parent.



998
999
1000
# File 'lib/rubinius/code/ast/definitions.rb', line 998

def parent
  @parent
end

Instance Method Details

#bytecode(g) ⇒ Object



1006
1007
1008
1009
1010
1011
1012
# File 'lib/rubinius/code/ast/definitions.rb', line 1006

def bytecode(g)
  pos(g)

  name_bytecode(g)
  @parent.bytecode(g)
  g.send :open_module_under, 2
end

#to_sexpObject



1014
1015
1016
# File 'lib/rubinius/code/ast/definitions.rb', line 1014

def to_sexp
  [:colon2, @parent.to_sexp, @name]
end