Sha256: 8b8edcad3b27677e29c9eb7f1386f315de6059c34ae32d2ed8350feb402f48af

Contents?: true

Size: 803 Bytes

Versions: 1

Compression:

Stored size: 803 Bytes

Contents

module Parser
  module AST

    ##
    # {Parser::AST::Node} contains information about a single AST node and its
    # child nodes, it extends the basic `AST::Node` class provided by the "ast"
    # Gem.
    #
    # @!attribute [r] location
    #  @return [Parser::Source::Map]
    #
    class Node < ::AST::Node
      attr_reader :location

      alias loc location

      ##
      # Assigns various properties to the current AST node. Currently only the
      # location can be set.
      #
      # @param [Hash] properties
      #
      # @option properties [Parser::Source::Map] :location Location information
      #  of the node.
      #
      def assign_properties(properties)
        if (location = properties[:location])
          @location = location
        end
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parser-2.0.0.pre2 lib/parser/ast/node.rb