Closed GoogleCodeExporter closed 8 years ago
The YAML parser in Ruby 1.8 has many deficiencies. So many that in Ruby 1.9 it
is completely abandoned in favor of libyaml (psych).
Supporting weird features of Ruby 1.8 would create more problems for 1.9 and
2.0 users.
I think the best way to continue is to mention this as yet another intentional
deviation form the specification on the wiki
(http://code.google.com/p/snakeyaml/wiki/Documentation#Deviations_from_the_speci
fication).
Original comment by py4fun@gmail.com
on 1 Apr 2013 at 3:49
Since the spec allows duplicate anchors, is it really "weird behavior"?
Additionally, it seems very easy to support -- just comment out the check, and
later anchors with the same ID replace existing anchors, as they are
encountered.
Original comment by llas...@gmail.com
on 1 Apr 2013 at 4:57
[deleted comment]
Try to parse the YAML document with duplicate anchors with Ruby 1.9. If it does
not work, then we can consider this as a bug which is fixed now in Ruby.
Otherwise, feel free to implement the fix in SnakeYAML.
Original comment by py4fun@gmail.com
on 2 Apr 2013 at 4:52
Ah, good check. And the default Ruby 1.9 (1.9.3) YAML parser does accept them
without complaint. Patch attached, although I'm not certain the test case is
done in the correct fashion to follow project conventions.
Original comment by llas...@gmail.com
on 2 Apr 2013 at 11:32
Attachments:
Give it a try:
http://code.google.com/p/snakeyaml/source/detail?r=cf3404e3b61d7c4fb1081291c3b75
5d2e1ae5fb4
Original comment by py4fun@gmail.com
on 2 Apr 2013 at 9:51
Yep -- lets me parse my problem input documents. Thanks!
Original comment by llas...@gmail.com
on 3 Apr 2013 at 2:11
It will be delivered in version 1.13 (you can already try the 1.13-SNAPSHOT)
http://code.google.com/p/snakeyaml/wiki/changes
Original comment by py4fun@gmail.com
on 3 Apr 2013 at 4:04
Original issue reported on code.google.com by
llas...@gmail.com
on 1 Apr 2013 at 12:29