Class: FastRuby::GetLocalsProcessor
- Defined in:
- lib/fastruby/getlocals.rb
Instance Attribute Summary collapse
-
#locals ⇒ Object
readonly
Returns the value of attribute locals.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ GetLocalsProcessor
constructor
A new instance of GetLocalsProcessor.
- #process_lasgn(tree) ⇒ Object
Constructor Details
#initialize ⇒ GetLocalsProcessor
Returns a new instance of GetLocalsProcessor.
30 31 32 33 34 |
# File 'lib/fastruby/getlocals.rb', line 30 def initialize super() self.require_empty = false @locals = Set.new end |
Instance Attribute Details
#locals ⇒ Object (readonly)
Returns the value of attribute locals.
28 29 30 |
# File 'lib/fastruby/getlocals.rb', line 28 def locals @locals end |
Class Method Details
.get_locals(tree) ⇒ Object
41 42 43 44 45 |
# File 'lib/fastruby/getlocals.rb', line 41 def self.get_locals(tree) processor = GetLocalsProcessor.new processor.process(tree) processor.locals end |
Instance Method Details
#process_lasgn(tree) ⇒ Object
36 37 38 39 |
# File 'lib/fastruby/getlocals.rb', line 36 def process_lasgn(tree) @locals << tree[1] tree.dup end |