Skip to content

Commit

Permalink
* ext/psych/lib/psych/visitors/to_ruby.rb: ToRuby visitor can be
Browse files Browse the repository at this point in the history
  constructed with a ScalarScanner.
* ext/psych/lib/psych/visitors/yaml_tree.rb: ScalarScanner can be
  passed to the YAMLTree visitor.
  • Loading branch information
tenderlove committed Oct 3, 2011
1 parent 89ff730 commit 68a91d5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rdoc
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/psych/visitors/to_ruby.rb
Expand Up @@ -9,10 +9,10 @@ module Visitors
###
# 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

Expand Down
4 changes: 2 additions & 2 deletions lib/psych/visitors/yaml_tree.rb
Expand Up @@ -12,13 +12,13 @@ class YAMLTree < Psych::Visitors::Visitor
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|
Expand Down

0 comments on commit 68a91d5

Please sign in to comment.