Class: Rubinius::ToolSet.current::TS::AST::ModuleName

Inherits:
Node
  • Object
show all
Defined in:
lib/rubinius/ast/definitions.rb

Direct Known Subclasses

ScopedModuleName, ToplevelModuleName

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

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, name) ⇒ ModuleName

Returns a new instance of ModuleName.



855
856
857
858
# File 'lib/rubinius/ast/definitions.rb', line 855

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

Instance Attribute Details

#nameObject

Returns the value of attribute name.



853
854
855
# File 'lib/rubinius/ast/definitions.rb', line 853

def name
  @name
end

Instance Method Details

#bytecode(g) ⇒ Object



865
866
867
868
869
870
871
# File 'lib/rubinius/ast/definitions.rb', line 865

def bytecode(g)
  pos(g)

  name_bytecode(g)
  g.push_scope
  g.send :open_module, 2
end

#name_bytecode(g) ⇒ Object



860
861
862
863
# File 'lib/rubinius/ast/definitions.rb', line 860

def name_bytecode(g)
  g.push_rubinius
  g.push_literal @name
end

#to_sexpObject



873
874
875
# File 'lib/rubinius/ast/definitions.rb', line 873

def to_sexp
  @name
end