diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-21 03:10:27 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-21 03:10:27 +0000 |
commit | be1206c0ace306ebfbb3ab9ddd1cfec8fee230a9 (patch) | |
tree | 1462414ddae06cd621290b057d92c31d6935204b /lib/rexml/validation | |
parent | 091cdca65ed229146ed1f9f1eb4c80edfe4b504b (diff) | |
download | ruby-be1206c0ace306ebfbb3ab9ddd1cfec8fee230a9.tar.gz |
* lib/rexml/**/*.rb: removed commented-out code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/validation')
-rw-r--r-- | lib/rexml/validation/relaxng.rb | 21 | ||||
-rw-r--r-- | lib/rexml/validation/validation.rb | 12 |
2 files changed, 0 insertions, 33 deletions
diff --git a/lib/rexml/validation/relaxng.rb b/lib/rexml/validation/relaxng.rb index 2441901d7b..370efd5a98 100644 --- a/lib/rexml/validation/relaxng.rb +++ b/lib/rexml/validation/relaxng.rb @@ -145,7 +145,6 @@ module REXML def next( event ) #print "In next with #{event.inspect}. " - #puts "Next (#@current) is #{@events[@current]}" #p @previous return @previous.pop.next( event ) if @events[@current].nil? expand_ref_in( @events, @current ) if @events[@current].class == Ref @@ -154,19 +153,15 @@ module REXML @events[@current-1].previous = self return @events[@current-1].next( event ) end - #puts "Current isn't a state" if ( @events[@current].matches?(event) ) @current += 1 if @events[@current].nil? - #puts "#{inspect[0,5]} 1RETURNING #{@previous.inspect[0,5]}" return @previous.pop elsif @events[@current].kind_of? State @current += 1 - #puts "#{inspect[0,5]} 2RETURNING (#{@current-1}) #{@events[@current-1].inspect[0,5]}; on return, next is #{@events[@current]}" @events[@current-1].previous = self return @events[@current-1] else - #puts "#{inspect[0,5]} RETURNING self w/ next(#@current) = #{@events[@current]}" return self end else @@ -393,13 +388,10 @@ module REXML # Remove the references # Find the events end - #puts "In next with #{event.inspect}." - #puts "events is #{@events.inspect}" unless @events @events = [] return nil end - #puts "current = #@current" super end @@ -409,8 +401,6 @@ module REXML end def expected - #puts "IN CHOICE EXPECTED" - #puts "EVENTS = #{@events.inspect}" return [@events[@current]] if @events.size > 0 return @choices.collect do |x| if x[0].kind_of? State @@ -479,8 +469,6 @@ module REXML @choice += 1 end - #puts "In next with #{event.inspect}." - #puts "events is #{@events.inspect}" @events = [] unless @events end @@ -491,29 +479,22 @@ module REXML return nil unless @events[@current] expand_ref_in( @events, @current ) if @events[@current].class == Ref - #puts "In next with #{event.inspect}." - #puts "Next (#@current) is #{@events[@current]}" if ( @events[@current].kind_of? State ) @current += 1 @events[@current-1].previous = self return @events[@current-1].next( event ) end - #puts "Current isn't a state" return @previous.pop.next( event ) if @events[@current].nil? if ( @events[@current].matches?(event) ) @current += 1 if @events[@current].nil? - #puts "#{inspect[0,5]} 1RETURNING self" unless @choices[@choice].nil? return self unless @choices[@choice].nil? - #puts "#{inspect[0,5]} 1RETURNING #{@previous[-1].inspect[0,5]}" return @previous.pop elsif @events[@current].kind_of? State @current += 1 - #puts "#{inspect[0,5]} 2RETURNING (#{@current-1}) #{@events[@current-1].inspect[0,5]}; on return, next is #{@events[@current]}" @events[@current-1].previous = self return @events[@current-1] else - #puts "#{inspect[0,5]} RETURNING self w/ next(#@current) = #{@events[@current]}" return self end else @@ -527,8 +508,6 @@ module REXML end def expected - #puts "IN CHOICE EXPECTED" - #puts "EVENTS = #{@events.inspect}" return [@events[@current]] if @events[@current] return @choices[@choice..-1].collect do |x| if x[0].kind_of? State diff --git a/lib/rexml/validation/validation.rb b/lib/rexml/validation/validation.rb index 8042e5d062..bab7f225a5 100644 --- a/lib/rexml/validation/validation.rb +++ b/lib/rexml/validation/validation.rb @@ -15,8 +15,6 @@ module REXML puts @root.inspect end def validate( event ) - #puts "Current: #@current" - #puts "Event: #{event.inspect}" @attr_stack = [] unless defined? @attr_stack match = @current.next(event) raise ValidationException.new( "Validation error. Expected: "+ @@ -27,7 +25,6 @@ module REXML # Check for attributes case event[0] when :start_element - #puts "Checking attributes" @attr_stack << event[2] begin sattr = [:start_attribute, nil] @@ -35,22 +32,14 @@ module REXML text = [:text, nil] k, = event[2].find { |key,value| sattr[1] = key - #puts "Looking for #{sattr.inspect}" m = @current.next( sattr ) - #puts "Got #{m.inspect}" if m # If the state has text children... - #puts "Looking for #{eattr.inspect}" - #puts "Expect #{m.expected}" if m.matches?( eattr ) - #puts "Got end" @current = m else - #puts "Didn't get end" text[1] = value - #puts "Looking for #{text.inspect}" m = m.next( text ) - #puts "Got #{m.inspect}" text[1] = nil return false unless m @current = m if m @@ -94,7 +83,6 @@ module REXML end def matches?( event ) - #puts "#@event_type =? #{event[0]} && #@event_arg =? #{event[1]} " return false unless event[0] == @event_type case event[0] when nil |