Module: Mutant::NodeHelpers
- Defined in:
- lib/mutant/node_helpers.rb
Overview
Mixin for node helpers
Constant Summary collapse
- NAN =
s(:send, s(:float, 0.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)
- NEGATIVE_INFINITY =
s(:send, s(:float, -1.0), :/, s(:args, s(:float, 0.0)))
- RAISE =
s(:send, nil, :raise)
- N_TRUE =
s(:true)
- N_FALSE =
s(:false)
- N_NIL =
s(:nil)
- N_EMPTY =
s(:empty)
Class Method Summary collapse
-
.s(type, *children) ⇒ Parser::AST::Node
private
Build node.
Instance Method Summary collapse
-
#n_not(node) ⇒ Parser::AST::Node
private
Build a negated boolean node.
Class Method Details
.s(type, *children) ⇒ Parser::AST::Node
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Build node
15 16 17 |
# File 'lib/mutant/node_helpers.rb', line 15 def s(type, *children) ::Parser::AST::Node.new(type, children) end |
Instance Method Details
#n_not(node) ⇒ Parser::AST::Node
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Build a negated boolean node
44 45 46 |
# File 'lib/mutant/node_helpers.rb', line 44 def n_not(node) s(:send, node, :!) end |