class Crispr::Mutations::Boolean
Currently supports toggling ‘true` to `false` and `false` to `true`.
Provides boolean-specific AST mutations.
def mutations_for(node)
-
(Array
- mutated Ruby source code strings)
Parameters:
-
node
(Parser::AST::Node
) -- the AST node to inspect
def mutations_for(node) return [] unless node.is_a?(Parser::AST::Node) case node.type when :true [Unparser.unparse(Parser::AST::Node.new(:false))] when :false [Unparser.unparse(Parser::AST::Node.new(:true))] else [] end end