lib/rley/parser/parse_forest_builder.rb in rley-0.3.06 vs lib/rley/parser/parse_forest_builder.rb in rley-0.3.07
- old
+ new
@@ -90,12 +90,13 @@
when :revisit
# Retrieve the already existing node corresponding
# to re-visited entry
popular = @entry2node[anEntry]
-
- # Share with parent
- curr_parent.add_subnode(popular)
+
+ # Share with parent (if needed)...
+ children = curr_parent.subnodes
+ curr_parent.add_subnode(popular) unless children.include? popular
else
raise NotImplementedError
end
end