Sha256: f66b7f97f20e4b439de4cf414d45c118a0b05d41971d3e7bc32009ea661c405d

Contents?: true

Size: 458 Bytes

Versions: 3

Compression:

Stored size: 458 Bytes

Contents

# frozen_string_literal: true

module Synvert::Core
  # UnlessExistCondition checks if matching node doesn't exist in the node children.
  class Rewriter::UnlessExistCondition < Rewriter::Condition
    # check if none of child node matches the rules.
    def match?
      match = false
      @instance.current_node.recursive_children do |child_node|
        match = match || (child_node && child_node.match?(@rules))
      end
      !match
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
synvert-core-0.17.0 lib/synvert/core/rewriter/condition/unless_exist_condition.rb
synvert-core-0.16.1 lib/synvert/core/rewriter/condition/unless_exist_condition.rb
synvert-core-0.16.0 lib/synvert/core/rewriter/condition/unless_exist_condition.rb