From b4c0f7f54d9652e73e77a8703da5d031f70041ea Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 29 Jul 2011 10:15:23 -0700 Subject: sync with ruby trunk --- lib/psych.rb | 3 +++ lib/psych/visitors/to_ruby.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/psych.rb b/lib/psych.rb index 31d73c1..8a4d63a 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -98,6 +98,9 @@ module Psych class Exception < RuntimeError end + class BadAlias < Exception + end + autoload :Stream, 'psych/stream' ### diff --git a/lib/psych/visitors/to_ruby.rb b/lib/psych/visitors/to_ruby.rb index b8eb698..fd899f6 100644 --- a/lib/psych/visitors/to_ruby.rb +++ b/lib/psych/visitors/to_ruby.rb @@ -201,7 +201,7 @@ module Psych end def visit_Psych_Nodes_Alias o - @st[o.anchor] + @st.fetch(o.anchor) { raise BadAlias, "Unknown alias: #{o.anchor}" } end private -- cgit v1.2.3