Class: Synvert::Rewriter::Scope
- Inherits:
-
Object
- Object
- Synvert::Rewriter::Scope
- Defined in:
- lib/synvert/rewriter/scopes.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ Scope
constructor
A new instance of Scope.
- #matching_nodes(nodes) ⇒ Object
Constructor Details
#initialize(options) ⇒ Scope
Returns a new instance of Scope.
24 25 26 |
# File 'lib/synvert/rewriter/scopes.rb', line 24 def initialize() = end |
Instance Method Details
#matching_nodes(nodes) ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/synvert/rewriter/scopes.rb', line 28 def matching_nodes(nodes) matching_nodes = [] while node = nodes.shift matching_nodes << node if node.match?() node.recursive_children do |child_node| matching_nodes << child_node if child_node.match?() end end matching_nodes end |