Sha256: f4b6d2bcaa1df0dc962c6fa453a2358e706289bb309479da89e5b84b83f69e18

Contents?: true

Size: 690 Bytes

Versions: 7

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true

module Unparser
  module NodeHelpers

    # Helper for building nodes
    #
    # @param [Symbol]
    #
    # @return [Parser::AST::Node]
    #
    # @api private
    #
    # ignore :reek:UncommunicativeMethodName
    # ignore :reek:UtilityFunction
    def s(type, *children)
      Parser::AST::Node.new(type, children)
    end

    # Helper for building nodes
    #
    # @param [Symbol]
    #
    # @return [Parser::AST::Node]
    #
    # @api private
    #
    # ignore :reek:UncommunicativeMethodName
    # ignore :reek:UtilityFunction
    def n(type, children = [])
      Parser::AST::Node.new(type, children)
    end

  end # NodeHelpers
end # Unparser

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
unparser-0.4.5 lib/unparser/node_helpers.rb
unparser-0.4.4 lib/unparser/node_helpers.rb
unparser-0.4.3 lib/unparser/node_helpers.rb
unparser-0.4.2 lib/unparser/node_helpers.rb
unparser-0.4.1 lib/unparser/node_helpers.rb
unparser-0.4.0 lib/unparser/node_helpers.rb
unparser-0.3.0 lib/unparser/node_helpers.rb