2014-06-29 21:25:17 +00:00
|
|
|
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)
|
2015-11-13 04:47:47 +00:00
|
|
|
::Parser::AST::Node.new(type, children)
|
2014-06-29 21:25:17 +00:00
|
|
|
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
|