From e0f7bb39b72f060232e84303ea7a4202883a959d Mon Sep 17 00:00:00 2001 From: kou Date: Mon, 9 Apr 2018 16:00:49 +0000 Subject: 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 --- lib/rexml/parsers/xpathparser.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/rexml/parsers/xpathparser.rb') diff --git a/lib/rexml/parsers/xpathparser.rb b/lib/rexml/parsers/xpathparser.rb index 5e0e429240..9577b6dcbe 100644 --- a/lib/rexml/parsers/xpathparser.rb +++ b/lib/rexml/parsers/xpathparser.rb @@ -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 -- cgit v1.2.3