Sha256: 1e5e0f9c7577c83189934db3737423d440d08898dbf01ead8495d240db0ba1d5

Contents?: true

Size: 426 Bytes

Versions: 43

Compression:

Stored size: 426 Bytes

Contents

# frozen_string_literal: true

module Mutant
  # An AST Parser
  class Parser
    include Adamantium::Mutable, Equalizer.new

    # Initialize object
    #
    # @return [undefined]
    def initialize
      @cache = {}
    end

    # Parse path into AST
    #
    # @param [Pathname] path
    #
    # @return [AST::Node]
    def call(path)
      @cache[path] ||= Unparser.parse(path.read)
    end

  end # Parser
end # Mutant

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
mutant-0.10.25 lib/mutant/parser.rb
mutant-0.10.24 lib/mutant/parser.rb
mutant-0.10.23 lib/mutant/parser.rb
mutant-0.10.22 lib/mutant/parser.rb
mutant-0.10.21 lib/mutant/parser.rb
mutant-0.10.20 lib/mutant/parser.rb
mutant-0.10.19 lib/mutant/parser.rb
mutant-0.10.18 lib/mutant/parser.rb
mutant-0.10.17 lib/mutant/parser.rb
mutant-0.10.16 lib/mutant/parser.rb
mutant-0.10.15 lib/mutant/parser.rb
mutant-0.10.14 lib/mutant/parser.rb
mutant-0.10.13 lib/mutant/parser.rb
mutant-0.10.12 lib/mutant/parser.rb
mutant-0.10.11 lib/mutant/parser.rb
mutant-0.10.10 lib/mutant/parser.rb
mutant-0.10.9 lib/mutant/parser.rb
mutant-0.10.8 lib/mutant/parser.rb
mutant-0.10.7 lib/mutant/parser.rb
mutant-0.10.6 lib/mutant/parser.rb