зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
bdadd49940
Коммит
1721fca3ad
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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|
|
||||
|
|
Загрузка…
Ссылка в новой задаче