Sha256: 51abefa8aa9efb8871a4b2339a72cc28e990fa63eda6b06c9abc2cf014bea431

Contents?: true

Size: 699 Bytes

Versions: 6

Compression:

Stored size: 699 Bytes

Contents

module Mutant
  # Mixin for node helpers
  module NodeHelpers

    # Build node
    #
    # @param [Symbol] type
    #
    # @return [Parser::AST::Node]
    #
    # @api private
    #
    def s(type, *children)
      Parser::AST::Node.new(type, children)
    end
    module_function :s


    NAN               = s(:send, s(:float,  0.0), :/, s(:args, s(:float, 0.0)))
    NEGATIVE_INFINITY = s(:send, s(:float, -1.0), :/, s(:args, s(:float, 0.0)))
    INFINITY          = s(:send, s(:float,  1.0), :/, s(:args, s(:float, 0.0)))
    NEW_OBJECT        = s(:send, s(:const, s(:cbase), :Object), :new)

    N_NIL             = s(:nil)
    N_EMPTY           = s(:empty)

  end # NodeHelpers
end # Mutant

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mutant-0.3.0.beta7 lib/mutant/node_helpers.rb
mutant-0.3.0.beta6 lib/mutant/node_helpers.rb
mutant-0.3.0.beta5 lib/mutant/node_helpers.rb
mutant-0.3.0.beta4 lib/mutant/node_helpers.rb
mutant-0.3.0.beta3 lib/mutant/node_helpers.rb
mutant-0.3.0.beta2 lib/mutant/node_helpers.rb