]> granicus.if.org Git - vim/commitdiff
patch 8.2.3318: Vim9: cannot ignore quotes in number at the command line v8.2.3318
authorBram Moolenaar <Bram@vim.org>
Sun, 8 Aug 2021 17:56:28 +0000 (19:56 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 8 Aug 2021 17:56:28 +0000 (19:56 +0200)
Problem:    Vim9: cannot ignore quotes in number at the command line.
Solution:   Use in_vim9script() so that after ":vim9" quotes are ignored.

src/testdir/test_float_func.vim
src/typval.c
src/version.c

index 628bbb0c068101e944a9640c6b5d6b0894e9f91e..77687d1fc39ab6ca07b0658e788e51a73af6ab4c 100644 (file)
@@ -261,6 +261,10 @@ def Test_float_quotes()
   call assert_fails("echo string(123'456.7'89)", 'E116:')
 enddef
 
+func Test_float_quotes_from_legacy()
+  call assert_equal("\n123456.789", execute("vim9 echo 12'34'56.789"))
+endfunc
+
 func Test_float2nr()
   call assert_equal(1, float2nr(1.234))
   call assert_equal(123, float2nr(1.234e2))
index 389ca3427365c3bab168beacd1ab002a12c5456e..5a62fa069189dfa35e1677b4454d43f079602265 100644 (file)
@@ -1704,7 +1704,7 @@ eval_number(
        int         want_string UNUSED)
 {
     int                len;
-    int                skip_quotes = current_sctx.sc_version >= 4;
+    int                skip_quotes = current_sctx.sc_version >= 4 || in_vim9script();
 #ifdef FEAT_FLOAT
     char_u     *p;
     int                get_float = FALSE;
index aacefc03d795b99f9e59f75bdc2a8d21c8abb457..8971e5dd868f180da09d41afa5d5147beefcb8d7 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3318,
 /**/
     3317,
 /**/