]> granicus.if.org Git - vim/commitdiff
patch 8.2.0586: Vim9: # comment not sufficiently tested v8.2.0586
authorBram Moolenaar <Bram@vim.org>
Thu, 16 Apr 2020 20:54:32 +0000 (22:54 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 16 Apr 2020 20:54:32 +0000 (22:54 +0200)
Problem:    Vim9: # comment not sufficiently tested
Solution:   Check for preceding white space.

src/eval.c
src/testdir/test_vim9_script.vim
src/version.c

index af228965f77e63ad5ccc0f4064cb2bc9375650f0..1840f7420c5a084a0307b296920c1aaebfb8d613 100644 (file)
@@ -6143,7 +6143,7 @@ ex_execute(exarg_T *eap)
 
     if (eap->skip)
        ++emsg_skip;
-    while (*arg != NUL && *arg != '|' && *arg != '\n')
+    while (!ends_excmd2(eap->cmd, arg) || *arg == '"')
     {
        ret = eval1_emsg(&arg, &rettv, !eap->skip);
        if (ret == FAIL)
index a96910e8335a3ddce956a3e9ebc563cb9215c9d3..58363baca005485be846ed34255a6604d31424af 100644 (file)
@@ -1025,6 +1025,20 @@ def Test_vim9_comment()
       ':# something',
       ], 'E488:')
 
+  { # block start
+  } # block end
+  CheckDefFailure([
+      '{# comment',
+      ], 'E488:')
+  CheckDefFailure([
+      '{',
+      '}# comment',
+      ], 'E488:')
+
+  echo "yes" # comment
+  CheckDefFailure([
+      'echo "yes"# comment',
+      ], 'E488:')
   CheckScriptSuccess([
       'vim9script',
       'echo "yes" # something',
@@ -1041,6 +1055,29 @@ def Test_vim9_comment()
       'echo "yes" # something',
       ], 'E121:')
 
+  exe "echo" # comment
+  CheckDefFailure([
+      'exe "echo"# comment',
+      ], 'E488:')
+  CheckScriptSuccess([
+      'vim9script',
+      'exe "echo" # something',
+      ])
+  CheckScriptFailure([
+      'vim9script',
+      'exe "echo"# something',
+      ], 'E121:')
+  CheckDefFailure([
+      'exe # comment',
+      ], 'E1015:')
+  CheckScriptFailure([
+      'vim9script',
+      'exe# something',
+      ], 'E121:')
+  CheckScriptFailure([
+      'exe "echo" # something',
+      ], 'E121:')
+
   CheckDefFailure([
       'try# comment',
       'echo "yes"',
index ca8d71c1f39b95dabd9f4ebf7440f1316258eab8..5ff481f344dd677cc5b06ced4f00f85f805ce5b1 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    586,
 /**/
     585,
 /**/