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

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

Instance Attribute Summary

Attributes inherited from Container

#file, #name, #pre_exe, #variable_scope

Attributes inherited from ClosedScope

#body

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Container

#container_bytecode, #pop_state, #push_state, #to_sexp

Methods inherited from ClosedScope

#assign_local_reference, #attach_and_call, #module?, #nest_scope, #new_local, #new_nested_local, #search_local, #to_sexp

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, #to_sexp, #transform, transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk

Constructor Details

#initialize(body) ⇒ Script

Returns a new instance of Script.



1117
1118
1119
1120
# File 'lib/rubinius/ast/definitions.rb', line 1117

def initialize(body)
  super body
  @name = :__script__
end

Instance Method Details

#bytecode(g) ⇒ Object



1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
# File 'lib/rubinius/ast/definitions.rb', line 1122

def bytecode(g)
  super(g)

  container_bytecode(g) do
    @body.bytecode(g)
    g.pop
    g.push :true
    g.ret
  end
end

#sexp_nameObject



1133
1134
1135
# File 'lib/rubinius/ast/definitions.rb', line 1133

def sexp_name
  :script
end