Sha256: 3c183648686e0e02561eec8d8728167e77c9ed5304843adaf9ed80b45d7a258d

Contents?: true

Size: 1.01 KB

Versions: 4298

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

module Parser
  module AST

    ##
    # {Parser::AST::Node} contains information about a single AST node and its
    # child nodes. It extends the basic [AST::Node](https://www.rubydoc.info/gems/ast/AST/Node)
    # class provided by gem [ast](https://www.rubydoc.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

4,298 entries across 4,298 versions & 27 rubygems

Version Path
cybrid_api_id_ruby-0.123.124 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_bank_ruby-0.123.123 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_id_ruby-0.123.123 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_organization_ruby-0.123.123 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_bank_ruby-0.123.122 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_organization_ruby-0.123.122 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_id_ruby-0.123.122 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_bank_ruby-0.123.121 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_id_ruby-0.123.121 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_organization_ruby-0.123.121 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_bank_ruby-0.123.120 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_organization_ruby-0.123.120 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_id_ruby-0.123.120 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_bank_ruby-0.123.119 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_organization_ruby-0.123.119 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_id_ruby-0.123.119 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_bank_ruby-0.123.118 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_id_ruby-0.123.118 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_organization_ruby-0.123.118 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb
cybrid_api_bank_ruby-0.123.117 vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib/parser/ast/node.rb