lib/ravensat/ast/node.rb in ravensat-1.0.8 vs lib/ravensat/ast/node.rb in ravensat-1.0.9
- old
+ new
@@ -62,14 +62,18 @@
self if block_given?
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
+
AndNode.new(self, 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
+
OrNode.new(self, object)
end
def to_s
self.class.name