Sha256: d27f76b53f6163c890de36d1eee6ef12c079efccc3aab8dff8ee805e7cf76e45

Contents?: true

Size: 642 Bytes

Versions: 4

Compression:

Stored size: 642 Bytes

Contents

module Yoda
  module Parsing
    # Traverser searches {AST::Node} with the given queries.
    class Traverser
      require 'yoda/parsing/traverser/query_interface'
      require 'yoda/parsing/traverser/matcher'
      require 'yoda/parsing/traverser/result_set'
      include QueryInterface

      # @return [AST::Node]
      attr_reader :node

      # @param node [AST::Node]
      def initialize(node)
        @node = node
      end

      # @return [Enumerable<AST::Node>]
      def all_nodes
        all_nodes_for(node)
      end

      # @return [Enumerable<AST::Node>]
      def nesting
        node.nesting
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yoda-language-server-0.10.1 lib/yoda/parsing/traverser.rb
yoda-language-server-0.10.0 lib/yoda/parsing/traverser.rb
yoda-language-server-0.9.0 lib/yoda/parsing/traverser.rb
yoda-language-server-0.8.0 lib/yoda/parsing/traverser.rb