lib/capuchin/generator.rb
# Nodes that are guaranteed to leave a VM true or false (or nil) on
# the stack, meaning we don't need to do a full truthiness check.
Nodes that are guaranteed to leave a VM true or false (or nil) on
the stack, meaning we don't need to do a full truthiness check.
Nodes that are guaranteed to leave a VM true or false ( or nil ) on the stack meaning we don ' t need to do a full truthiness check .
def bool_safe?(o)
    if BoolSafeNodes.include?(o.class.name)
      return true
    end
    if Capuchin::Nodes::LogicalAndNode === o || Capuchin::Nodes::LogicalOrNode === o
      bool_safe?(o.left) && bool_safe?(o.value)
    end
    false
  end
def bool_safe? ( o ) if BoolSafeNodes . include? ( o . class . name ) return true end if Capuchin :: Nodes :: LogicalAndNode === o || Capuchin :: Nodes :: LogicalOrNode === o bool_safe? ( o . left ) && bool_safe? ( o . value ) end false end
Nodes that are guaranteed to leave a VM true or false (or nil) on
the stack, meaning we don't need to do a full truthiness check.
Nodes that are guaranteed to leave a VM true or false ( or nil ) on the stack meaning we don ' t need to do a full truthiness check .
o