Class: Mirah::AST::NodeProxy

Inherits:
Node
  • Object
show all
Includes:
Java::DubyLangCompiler::Node
Defined in:
lib/mirah/ast.rb

Instance Attribute Summary

Attributes inherited from Node

#children, #inferred_type, #newline, #parent, #position

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#<<, ===, #[], #[]=, #_set_parent, child, child_name, #child_nodes, #each, #empty?, #expr?, #inferred_type!, #initialize, #initialize_copy, #insert, #inspect, #inspect_children, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #string_value, #temp, #to_s, #top_level?, #validate_child, #validate_children

Constructor Details

This class inherits a constructor from Mirah::AST::Node

Class Method Details

._load(str) ⇒ Object



398
399
400
401
402
403
404
405
406
# File 'lib/mirah/ast.rb', line 398

def self._load(str)
  value = Marshal.load(str)
  if value.respond_to?(:proxy=)
    proxy = NodeProxy.new(value)
    proxy.proxy = proxy
  else
    value
  end
end

Instance Method Details

#__inline__(node) ⇒ Object



377
378
379
380
# File 'lib/mirah/ast.rb', line 377

def __inline__(node)
  node.parent = parent
  __setobj__(node)
end

#_dump(depth) ⇒ Object



394
395
396
# File 'lib/mirah/ast.rb', line 394

def _dump(depth)
  Marshal.dump(__getobj__)
end

#dupObject



382
383
384
385
386
387
388
389
390
391
392
# File 'lib/mirah/ast.rb', line 382

def dup
  value = __getobj__.dup
  if value.respond_to?(:proxy=)
    new = super
    new.__setobj__(value)
    new.proxy = new
    new
  else
    value
  end
end