From: Neil W. <neilw@ActiveState.com> - 2002-03-15 21:55:44
|
Oren Ben-Kiki [15/03/02 16:35 -0500]: > Nope because a parser produces the tree model and one can only detect a > subset of the duplicate keys there. For example: > > orders: > !invoice 012 : ... > !invoice 12 : ... You can write your example like this: orders: !invoice 10 : ... !invoice 12 : ... So it isn't an error anyway! :) Perhaps a less ambiguous example is: orders: !invoice 07 : ... !invoice 7 : ... > *Can't* be detected as a duplicate by a mere parser. One can only make it a > fatal error in the loader level; however there I see no reason to completely > rule out the "ignore duplicate key" policy. You've already parsed it > anyway... My only point was that if you're going to "ignore" the duplicate key, you shouldn't honour any anchors in its value. I think this should be an error, no matter what your application is: orders: !invoice 07 : ... !invoice 7 : name: &neil Neil web: "http://ttul.org/~nwatkiss" neilsname: *neil I think we all agree. The loader has to produce the error, not the parser. Of course, if the two strings happen to be identical, the parser might be able to skip the node, but that's probably more confusing than it's worth. Later, Neil |