lib/furnace/ast/node.rb in furnace-0.0.3 vs lib/furnace/ast/node.rb in furnace-0.0.4
- old
+ new
@@ -40,9 +40,19 @@
node.children = @children.dup
node.metadata = @metadata.dup
node
end
+ def ==(other)
+ if other.respond_to? :to_astlet
+ other = other.to_astlet
+ other.type == self.type &&
+ other.children == self.children
+ else
+ false
+ end
+ end
+
def index
parent.children.find_index(self)
end
def next
\ No newline at end of file