patch 7.4.2076 v7.4.2076
authorBram Moolenaar <Bram@vim.org>
Tue, 19 Jul 2016 20:43:11 +0000 (22:43 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 19 Jul 2016 20:43:11 +0000 (22:43 +0200)
Problem:    Syntax error when dict has '>' key.
Solution:   Check for endchar. (Ken Takata)

src/testdir/test_lambda.vim
src/userfunc.c
src/version.c

index 9e9979b0ce319890a4243bfa1ba4bf7f07c6c543..cbd4addce66a67f4345151b9013f7e96012943ea 100644 (file)
@@ -46,3 +46,8 @@ function Test_lambda_fails()
   call assert_fails('echo {a, a -> a + a}(1, 2)', 'E15:')
   call assert_fails('echo {a, b -> a + b)}(1, 2)', 'E15:')
 endfunc
+
+func Test_not_lamda()
+  let x = {'>' : 'foo'}
+  call assert_equal('foo', x['>'])
+endfunc
index ea1542385605e9208f046469a5b591841d3f7d42..9ffafc3714f4e97b3b5baa282c5fb79cc7171465 100644 (file)
@@ -150,7 +150,9 @@ func_init()
     hash_init(&func_hashtab);
 }
 
-/* Get function arguments. */
+/*
+ * Get function arguments.
+ */
     static int
 get_function_args(
     char_u     **argp,
@@ -232,7 +234,9 @@ get_function_args(
            break;
        }
     }
-    ++p;       /* skip the ')' */
+    if (*p != endchar)
+       goto err_ret;
+    ++p;       /* skip "endchar" */
 
     *argp = p;
     return OK;
index cb8fed64fc44a4aaa31339475243fcea4a7c60d5..6f1d53a26185a74af9a90329930cddb2dd26187a 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2076,
 /**/
     2075,
 /**/