summaryrefslogtreecommitdiff
path: root/lib/rexml/parsers/xpathparser.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-01 13:46:53 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-01 13:46:53 +0000
commit46321a9a313d934d23949ccecaa358c1761fd93c (patch)
tree83769e97e39f1fd0e5ca45e821082b6b843578a7 /lib/rexml/parsers/xpathparser.rb
parent952385b71267a843f8e71d0573f5b2fcf5709787 (diff)
* lib/xmlrpc, lib/rexml, test/ruby/test_array.rb,
test/ruby/test_unicode_escape.rb, test/scanf/test_scanf.rb, test/rss/rss-assertions.rb: fix indentation to remove warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/parsers/xpathparser.rb')
-rw-r--r--lib/rexml/parsers/xpathparser.rb76
1 files changed, 38 insertions, 38 deletions
diff --git a/lib/rexml/parsers/xpathparser.rb b/lib/rexml/parsers/xpathparser.rb
index 152198856d..49450b4aef 100644
--- a/lib/rexml/parsers/xpathparser.rb
+++ b/lib/rexml/parsers/xpathparser.rb
@@ -39,10 +39,10 @@ module REXML
case op
when :node
when :attribute
- string << "/" if string.size > 0
- string << "@"
+ string << "/" if string.size > 0
+ string << "@"
when :child
- string << "/" if string.size > 0
+ string << "/" if string.size > 0
when :descendant_or_self
string << "/"
when :self
@@ -51,8 +51,8 @@ module REXML
string << ".."
when :any
string << "*"
- when :text
- string << "text()"
+ when :text
+ string << "text()"
when :following, :following_sibling,
:ancestor, :ancestor_or_self, :descendant,
:namespace, :preceding, :preceding_sibling
@@ -70,13 +70,13 @@ module REXML
string << ']'
when :document
document = true
- when :function
- string << path.shift
- string << "( "
- string << predicate_to_string( path.shift[0] ) {|x| abbreviate( x )}
- string << " )"
- when :literal
- string << %Q{ "#{path.shift}" }
+ when :function
+ string << path.shift
+ string << "( "
+ string << predicate_to_string( path.shift[0] ) {|x| abbreviate( x )}
+ string << " )"
+ when :literal
+ string << %Q{ "#{path.shift}" }
else
string << "/" unless string.size == 0
string << "UNKNOWN("
@@ -84,7 +84,7 @@ module REXML
string << ")"
end
end
- string = "/"+string if document
+ string = "/"+string if document
return string
end
@@ -653,39 +653,39 @@ module REXML
def parse_args( string )
arguments = []
ind = 0
- inquot = false
- inapos = false
+ inquot = false
+ inapos = false
depth = 1
begin
case string[ind]
when ?"
- inquot = !inquot unless inapos
+ inquot = !inquot unless inapos
when ?'
- inapos = !inapos unless inquot
+ inapos = !inapos unless inquot
else
- unless inquot or inapos
- case string[ind]
- when ?(
- depth += 1
+ unless inquot or inapos
+ case string[ind]
+ when ?(
+ depth += 1
if depth == 1
- string = string[1..-1]
- ind -= 1
+ string = string[1..-1]
+ ind -= 1
+ end
+ when ?)
+ depth -= 1
+ if depth == 0
+ s = string[0,ind].strip
+ arguments << s unless s == ""
+ string = string[ind+1..-1]
end
- when ?)
- depth -= 1
- if depth == 0
- s = string[0,ind].strip
- arguments << s unless s == ""
- string = string[ind+1..-1]
- end
- when ?,
- if depth == 1
- s = string[0,ind].strip
- arguments << s unless s == ""
- string = string[ind+1..-1]
- ind = -1
- end
- end
+ when ?,
+ if depth == 1
+ s = string[0,ind].strip
+ arguments << s unless s == ""
+ string = string[ind+1..-1]
+ ind = -1
+ end
+ end
end
end
ind += 1