Class: Opal::Rewriters::ForRewriter::LocalVariableAssigns

Inherits:
Base
  • Object
show all
Defined in:
opal/lib/opal/rewriters/for_rewriter.rb

Constant Summary

Constants inherited from Base

Base::DUMMY_LOCATION

Instance Attribute Summary collapse

Attributes inherited from Base

#current_node

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#append_to_body, #begin_with_stmts, #dynamic!, #error, #on_top, #prepend_to_body, #process, s, #s, #stmts_of

Constructor Details

#initializeLocalVariableAssigns

Returns a new instance of LocalVariableAssigns.



81
82
83
# File 'opal/lib/opal/rewriters/for_rewriter.rb', line 81

def initialize
  @result = Set.new
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



73
74
75
# File 'opal/lib/opal/rewriters/for_rewriter.rb', line 73

def result
  @result
end

Class Method Details

.find(node) ⇒ Object



75
76
77
78
79
# File 'opal/lib/opal/rewriters/for_rewriter.rb', line 75

def self.find(node)
  processor = new
  processor.process(node)
  processor.result.to_a
end

Instance Method Details

#on_lvasgn(node) ⇒ Object



85
86
87
88
89
# File 'opal/lib/opal/rewriters/for_rewriter.rb', line 85

def on_lvasgn(node)
  name, _ = *node
  result << name
  super
end