From b728aad212a0a9f9103b7a9d58736f8767ac0c45 Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 6 Sep 2018 01:49:18 +0300 Subject: runtime/msgpack: Fix inf/nan regexp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not making minus sign optional as inf/nan without optional minus should’ve already been handled by the very first case. --- runtime/autoload/msgpack.vim | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'runtime') diff --git a/runtime/autoload/msgpack.vim b/runtime/autoload/msgpack.vim index 09c99c940d..7dd225e3d9 100644 --- a/runtime/autoload/msgpack.vim +++ b/runtime/autoload/msgpack.vim @@ -605,13 +605,10 @@ function msgpack#eval(s, special_objs) abort call add(expr, dec) endif endif - elseif s =~# '-\?\%(inf\|nan\)' - if s[0] is# '-' - call add(expr, '-') - let s = s[1:] - endif - call add(expr, s:MSGPACK_SPECIAL_OBJECTS[s[0:2]]) - let s = s[3:] + elseif s =~# '\v^\-%(inf|nan)' + call add(expr, '-') + call add(expr, s:MSGPACK_SPECIAL_OBJECTS[s[1:3]]) + let s = s[4:] elseif stridx('="+', s[0]) != -1 let match = matchlist(s, '\v\C^(\=|\+\((\-?\d+)\)|)(\"%(\\.|[^\\"]+)*\")') if empty(match) -- cgit