summaryrefslogtreecommitdiff
path: root/lib/rexml/parsers/xpathparser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rexml/parsers/xpathparser.rb')
-rw-r--r--lib/rexml/parsers/xpathparser.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/rexml/parsers/xpathparser.rb b/lib/rexml/parsers/xpathparser.rb
index 41b2b8a5c1..6bac852d6b 100644
--- a/lib/rexml/parsers/xpathparser.rb
+++ b/lib/rexml/parsers/xpathparser.rb
@@ -20,7 +20,7 @@ module REXML
path.gsub!(/([\(\[])\s+/, '\1') # Strip ignorable spaces
path.gsub!( /\s+([\]\)])/, '\1' )
parsed = []
- path = LocationPath(path, parsed)
+ path = OrExpr(path, parsed)
parsed
end
@@ -302,7 +302,7 @@ module REXML
path = path[1..-1]
end
parsed << :processing_instruction
- parsed << literal
+ parsed << (literal || '')
when NCNAMETEST
#puts "NCNAMETEST"
prefix = $1
@@ -589,9 +589,10 @@ module REXML
when /^(\w[-\w]*)(?:\()/
#puts "PrimaryExpr :: Function >>> #$1 -- '#$''"
fname = $1
- path = $'
+ tmp = $'
#puts "#{fname} =~ #{NT.inspect}"
- #return nil if fname =~ NT
+ return path if fname =~ NT
+ path = tmp
parsed << :function
parsed << fname
path = FunctionCall(path, parsed)