lib/ravensat/ast/initial_node.rb in ravensat-1.0.8 vs lib/ravensat/ast/initial_node.rb in ravensat-1.0.9
- old
+ new
@@ -1,13 +1,17 @@
module Ravensat
class InitialNode < Node
def &(object)
raise TypeError.new("#{object.class} can't be coerced into Ravensat::Node") unless object.is_a? Node
+ return self if object.is_a? NilNode
+
object
end
def |(object)
raise TypeError.new("#{object.class} can't be coerced into Ravensat::Node") unless object.is_a? Node
+ return self if object.is_a? NilNode
+
object
end
end
end