Module: Mutant::AST::Types

Included in:
Mutator::Node::Send
Defined in:
lib/mutant/ast/types.rb

Overview

Groups of node types

Constant Summary collapse

ASSIGNABLE_VARIABLES =
symbolset.(%w[ivasgn lvasgn cvasgn gvasgn])
INDEX_ASSIGN_OPERATOR =
:[]=
NOT_ASSIGNABLE =

Set of nodes that cannot be on the LHS of an assignment

symbolset.(%w[int float str dstr class module self nil])
OP_ASSIGN =

Set of op-assign types

symbolset.(%w[or_asgn and_asgn op_asgn])
NOT_STANDALONE =

Set of node types that are not valid when emitted standalone

symbolset.(%w[splat restarg block_pass])
INDEX_OPERATORS =
symbolset.(%w[[] []=])
UNARY_METHOD_OPERATORS =
symbolset.(%w[~@ +@ -@ !])
METHOD_OPERATORS =

Operators ruby implementeds as methods

symbolset.(%w[
  <=> === []= [] <= >= == !~ != =~ <<
  >> ** * % / | ^ & < > + - ~@ +@ -@ !
])
BINARY_METHOD_OPERATORS =
symbolset.(
  METHOD_OPERATORS - (INDEX_OPERATORS + UNARY_METHOD_OPERATORS)
)
OPERATOR_METHODS =
symbolset.(
  METHOD_OPERATORS + INDEX_OPERATORS + UNARY_METHOD_OPERATORS
)
BLACKLIST =

Nodes that are NOT handled by mutant.

not - 1.8 only, mutant does not support 1.8

symbolset.(%w[not])
EXTRA =

Nodes that are NOT generated by parser but used by mutant / unparser.

symbolset.(%w[empty])
ALL =

All node types mutant handles

symbolset.((Parser::Meta::NODE_TYPES + EXTRA) - BLACKLIST)