summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-03 21:00:50 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-03 21:00:50 +0000
commit1721fca3ada1c19211b01d7c8b18dac5e509fc0e (patch)
treedf32af462912f20cffa0ffaf79101569ea7723bb
parentbdadd499402bc12749758ded92588f3f36d04dda (diff)
* ext/psych/lib/psych/visitors/to_ruby.rb: ToRuby visitor can be
constructed with a ScalarScanner. * ext/psych/lib/psych/visitors/yaml_tree.rb: ScalarScanner can be passed to the YAMLTree visitor. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb6
-rw-r--r--ext/psych/lib/psych/visitors/yaml_tree.rb4
3 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 10408bba3a..d0e9872d4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Oct 4 05:59:24 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych/visitors/to_ruby.rb: ToRuby visitor can be
+ constructed with a ScalarScanner.
+ * ext/psych/lib/psych/visitors/yaml_tree.rb: ScalarScanner can be
+ passed to the YAMLTree visitor.
+
Tue Oct 4 05:47:23 2011 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/visitors/to_ruby.rb: Define Regexp::NOENCODING
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb
index b76cd7d5ec..5cef198dce 100644
--- a/ext/psych/lib/psych/visitors/to_ruby.rb
+++ b/ext/psych/lib/psych/visitors/to_ruby.rb
@@ -9,10 +9,10 @@ module Psych
###
# This class walks a YAML AST, converting each node to ruby
class ToRuby < Psych::Visitors::Visitor
- def initialize
- super
+ def initialize ss = ScalarScanner.new
+ super()
@st = {}
- @ss = ScalarScanner.new
+ @ss = ss
@domain_types = Psych.domain_types
end
diff --git a/ext/psych/lib/psych/visitors/yaml_tree.rb b/ext/psych/lib/psych/visitors/yaml_tree.rb
index 1f1acdbbcf..5a092850c3 100644
--- a/ext/psych/lib/psych/visitors/yaml_tree.rb
+++ b/ext/psych/lib/psych/visitors/yaml_tree.rb
@@ -12,13 +12,13 @@ module Psych
alias :finished? :finished
alias :started? :started
- def initialize options = {}, emitter = Psych::TreeBuilder.new
+ def initialize options = {}, emitter = TreeBuilder.new, ss = ScalarScanner.new
super()
@started = false
@finished = false
@emitter = emitter
@st = {}
- @ss = ScalarScanner.new
+ @ss = ss
@options = options
@dispatch_cache = Hash.new do |h,klass|