Sha256: 0929e55665e1a917617ee921c1d6dae3587f63382a91a4a641077fc7a598f86d

Contents?: true

Size: 989 Bytes

Versions: 43

Compression:

Stored size: 989 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](http://rdoc.info/gems/ast/AST/Node)
    # class provided by gem [ast](http://rdoc.info/gems/ast).
    #
    # @api public
    #
    # @!attribute [r] location
    #  Source map for this Node.
    #  @return [Parser::Source::Map]
    #
    class Node < ::AST::Node
      attr_reader :location

      alias loc location

      ##
      # Assigns various properties to this 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.dup if location.frozen?
          location.node = self
          @location = location
        end
      end
    end

  end
end

Version data entries

43 entries across 43 versions & 4 rubygems

Version Path
dirwatch-0.0.9 vendor/bundle/ruby/2.5.0/gems/parser-2.4.0.2/lib/parser/ast/node.rb
dirwatch-0.0.8 vendor/bundle/ruby/2.5.0/gems/parser-2.4.0.2/lib/parser/ast/node.rb
dirwatch-0.0.6 vendor/bundle/ruby/2.3.0/gems/parser-2.4.0.2/lib/parser/ast/node.rb
dirwatch-0.0.5 vendor/bundle/ruby/2.3.0/gems/parser-2.4.0.2/lib/parser/ast/node.rb
dirwatch-0.0.4 vendor/bundle/ruby/2.3.0/gems/parser-2.4.0.2/lib/parser/ast/node.rb
dirwatch-0.0.3 vendor/bundle/ruby/2.3.0/gems/parser-2.4.0.2/lib/parser/ast/node.rb
dirwatch-0.0.2 vendor/bundle/ruby/2.3.0/gems/parser-2.4.0.0/lib/parser/ast/node.rb
parser-2.4.0.2 lib/parser/ast/node.rb
parser-2.4.0.1 lib/parser/ast/node.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/parser-2.4.0.0/lib/parser/ast/node.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/parser-2.4.0.0/lib/parser/ast/node.rb
parser-2.4.0.0 lib/parser/ast/node.rb
parser-2.3.3.1 lib/parser/ast/node.rb
parser-2.3.3.0 lib/parser/ast/node.rb
parser-2.3.2.0 lib/parser/ast/node.rb
parser-2.3.1.4 lib/parser/ast/node.rb
parser-2.3.1.3 lib/parser/ast/node.rb
erruby_parser-2.3.1.2 lib/parser/ast/node.rb
parser-2.3.1.2 lib/parser/ast/node.rb
parser-2.3.1.1 lib/parser/ast/node.rb