summaryrefslogtreecommitdiff
path: root/lib/rexml/xpath_parser.rb
diff options
context:
space:
mode:
authorser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-10 02:01:04 +0000
committerser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-06-10 02:01:04 +0000
commit3289dfc78b4c5051b0079217a193ce50d5349506 (patch)
tree564ff1057a5341fa9b28cf03218851f8d0255f4f /lib/rexml/xpath_parser.rb
parentf2b75020ba193b6d20788c800fde583ca8e900d5 (diff)
-
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/xpath_parser.rb')
-rw-r--r--lib/rexml/xpath_parser.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/rexml/xpath_parser.rb b/lib/rexml/xpath_parser.rb
index 8aadb8ef86..ce6cec5374 100644
--- a/lib/rexml/xpath_parser.rb
+++ b/lib/rexml/xpath_parser.rb
@@ -43,8 +43,6 @@ module REXML
@variables[ variable_name ] = value
end
- private
-
def match( path_stack, nodeset )
while ( path_stack.size > 0 and nodeset.size > 0 )
#puts "PARSE: #{path_stack.inspect} '#{nodeset.collect{|n|n.class}.inspect}'"
@@ -55,6 +53,8 @@ module REXML
nodeset
end
+ private
+
def internal_parse path_stack, nodeset
#puts "INTERNAL_PARSE RETURNING WITH NO RESULTS" if nodeset.size == 0 or path_stack.size == 0
return nodeset if nodeset.size == 0 or path_stack.size == 0
@@ -423,10 +423,9 @@ module REXML
current_index = all_siblings.index( node )
preceding_siblings = all_siblings[ 0 .. current_index-1 ]
- preceding_siblings.reverse!
preceding = []
- recurse( preceding_siblings ) { |node| preceding << node }
- preceding.reverse
+ recurse( preceding_siblings ) { |node| preceding.unshift( node ) }
+ preceding
end
def equality_relational_compare( set1, op, set2 )