summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-07-29 10:15:23 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-07-29 10:15:23 -0700
commitb4c0f7f54d9652e73e77a8703da5d031f70041ea (patch)
treecfc4f6081510b568384e141254bfbbf7c8be35a4 /lib
parent478a7ac57bf802c11ff5d60fd547f5b2530691b4 (diff)
downloadpsych-b4c0f7f54d9652e73e77a8703da5d031f70041ea.zip
sync with ruby trunk
Diffstat (limited to 'lib')
-rw-r--r--lib/psych.rb3
-rw-r--r--lib/psych/visitors/to_ruby.rb2
2 files changed, 4 insertions, 1 deletions
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