diff options
-rw-r--r-- | src/testdir/test_vim9_assign.vim | 6 | ||||
-rw-r--r-- | src/testdir/test_vim9_disassemble.vim | 4 | ||||
-rw-r--r-- | src/testdir/test_vim9_expr.vim | 7 | ||||
-rw-r--r-- | src/testdir/test_vim9_func.vim | 10 | ||||
-rw-r--r-- | src/testdir/test_vim9_script.vim | 4 | ||||
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/vim9expr.c | 8 |
7 files changed, 26 insertions, 15 deletions
diff --git a/src/testdir/test_vim9_assign.vim b/src/testdir/test_vim9_assign.vim index df5fc7fe60..b1ff392149 100644 --- a/src/testdir/test_vim9_assign.vim +++ b/src/testdir/test_vim9_assign.vim @@ -2128,7 +2128,7 @@ def Test_var_declaration_fails() 'floats', 'floot', 'funcs', 'funk', 'jobs', 'jop', - 'lists', 'last' + 'lists', 'last', 'numbers', 'numbar', 'strings', 'strung', 'voids', 'viod'] @@ -2439,11 +2439,11 @@ def Test_unlet() ], 'E1105:', 2) v9.CheckDefExecFailure([ - 'g:dd = {"a": 1, 2: 2}' + 'g:dd = {"a": 1, 2: 2}', 'unlet g:dd[0z11]', ], 'E1029:', 2) v9.CheckDefExecFailure([ - 'g:str = "a string"' + 'g:str = "a string"', 'unlet g:str[0]', ], 'E1148: Cannot index a string', 2) diff --git a/src/testdir/test_vim9_disassemble.vim b/src/testdir/test_vim9_disassemble.vim index c1800c3128..9334d2410c 100644 --- a/src/testdir/test_vim9_disassemble.vim +++ b/src/testdir/test_vim9_disassemble.vim @@ -2106,7 +2106,7 @@ def Test_disassemble_compare() ' var aDict = {x: 2}', floatDecl, ' if ' .. case[0], - ' echo 42' + ' echo 42', ' endif', 'enddef'], 'Xdisassemble') source Xdisassemble @@ -2163,7 +2163,7 @@ def Test_disassemble_compare_const() for case in cases writefile(['def TestCase' .. nr .. '()', ' if ' .. case[0], - ' echo 42' + ' echo 42', ' endif', 'enddef'], 'Xdisassemble') source Xdisassemble diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim index f30cd8da19..9bb053fe76 100644 --- a/src/testdir/test_vim9_expr.vim +++ b/src/testdir/test_vim9_expr.vim @@ -1876,9 +1876,9 @@ def Test_expr7() if has('float') v9.CheckDefExecAndScriptFailure([ - 'g:one = 1.0' - 'g:two = 2.0' - 'echo g:one % g:two' + 'g:one = 1.0', + 'g:two = 2.0', + 'echo g:one % g:two', ], 'E804', 3) endif @@ -2490,6 +2490,7 @@ def Test_expr9_lambda() v9.CheckDefAndScriptSuccess(['var Fx = (a) => [0,', ' 1]']) v9.CheckDefAndScriptFailure(['var Fx = (a) => [0', ' 1]'], 'E696:', 2) + v9.CheckDefAndScriptFailure(['var l = [1 2]'], 'E696:', 1) # no error for existing script variable when checking for lambda lines =<< trim END diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 4011d7fe16..a88ba86485 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -440,22 +440,22 @@ def Test_missing_return() ' echo "no return"', ' else', ' return 0', - ' endif' + ' endif', 'enddef'], 'E1027:') v9.CheckDefFailure(['def Missing(): number', ' if g:cond', ' return 1', ' else', ' echo "no return"', - ' endif' + ' endif', 'enddef'], 'E1027:') v9.CheckDefFailure(['def Missing(): number', ' if g:cond', ' return 1', ' else', ' return 2', - ' endif' - ' return 3' + ' endif', + ' return 3', 'enddef'], 'E1095:') enddef @@ -1496,7 +1496,7 @@ enddef def Test_lambda_uses_assigned_var() v9.CheckDefSuccess([ - 'var x: any = "aaa"' + 'var x: any = "aaa"', 'x = filter(["bbb"], (_, v) => v =~ x)']) enddef diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim index 597e31ec1c..d0785dcf89 100644 --- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -3274,7 +3274,7 @@ def Test_vim9_comment_not_compiled() v9.CheckScriptSuccess([ 'vim9script', - 'new' + 'new', 'setline(1, ["# define pat", "last"])', ':$', 'dsearch /pat/ #comment', @@ -3283,7 +3283,7 @@ def Test_vim9_comment_not_compiled() v9.CheckScriptFailure([ 'vim9script', - 'new' + 'new', 'setline(1, ["# define pat", "last"])', ':$', 'dsearch /pat/#comment', diff --git a/src/version.c b/src/version.c index 412b3e83ea..9ce33cdbc8 100644 --- a/src/version.c +++ b/src/version.c @@ -732,6 +732,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 230, +/**/ 229, /**/ 228, diff --git a/src/vim9expr.c b/src/vim9expr.c index 8cd095c1a7..370dce315c 100644 --- a/src/vim9expr.c +++ b/src/vim9expr.c @@ -975,6 +975,7 @@ compile_list(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) int count = 0; int is_const; int is_all_const = TRUE; // reset when non-const encountered + int must_end = FALSE; for (;;) { @@ -993,6 +994,11 @@ compile_list(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) ++p; break; } + if (must_end) + { + semsg(_(e_missing_comma_in_list_str), p); + return FAIL; + } if (compile_expr0_ext(&p, cctx, &is_const) == FAIL) return FAIL; if (!is_const) @@ -1007,6 +1013,8 @@ compile_list(char_u **arg, cctx_T *cctx, ppconst_T *ppconst) return FAIL; } } + else + must_end = TRUE; whitep = p; p = skipwhite(p); } |