Sha256: 3e0a766fd36d71e1a7bda3b71aaf61ec636fb33f8b9a25e690e26db5903233fd

Contents?: true

Size: 507 Bytes

Versions: 8

Compression:

Stored size: 507 Bytes

Contents

module Mutant
  module AST
    # Mixin for node sexp syntax
    module Sexp

    private

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

      # Build a negated boolean node
      #
      # @param [Parser::AST::Node] node
      #
      # @return [Parser::AST::Node]
      def n_not(node)
        s(:send, node, :!)
      end

    end # Sexp
  end # AST
end # Mutant

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutant-0.8.16 lib/mutant/ast/sexp.rb
mutant-0.8.15 lib/mutant/ast/sexp.rb
mutant-0.8.14 lib/mutant/ast/sexp.rb
mutant-0.8.13 lib/mutant/ast/sexp.rb
mutant-0.8.12 lib/mutant/ast/sexp.rb
mutant-0.8.11 lib/mutant/ast/sexp.rb
mutant-0.8.10 lib/mutant/ast/sexp.rb
mutant-0.8.9 lib/mutant/ast/sexp.rb