1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

rexml: Fix a XPath bug of -

[Bug #14600]

* lib/rexml/parsers/xpathparser.rb: Fix a bug that "N-M" requires a space
  before "-".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kou 2018-04-09 16:00:49 +00:00
parent bbcab8c6f3
commit e0f7bb39b7

View file

@ -421,13 +421,13 @@ module REXML
rest
end
#| AdditiveExpr ('+' | S '-') MultiplicativeExpr
#| AdditiveExpr ('+' | '-') MultiplicativeExpr
#| MultiplicativeExpr
def AdditiveExpr path, parsed
n = []
rest = MultiplicativeExpr( path, n )
if rest != path
while rest =~ /^\s*(\+| -)\s*/
while rest =~ /^\s*(\+|-)\s*/
if $1[0] == ?+
n = [ :plus, n, [] ]
else